summaryrefslogtreecommitdiff
path: root/envsetup.sh
diff options
context:
space:
mode:
author Zhuoyao Zhang <zhuoyao@google.com> 2024-05-20 18:31:12 +0000
committer Zhuoyao Zhang <zhuoyao@google.com> 2024-05-21 18:10:01 +0000
commitdfdf19f2254a65a6f85924e6b2cabb0d3c872de8 (patch)
tree54271e831971b8af87eb45f04d8487a9b3453c7b /envsetup.sh
parentd429640373b3f808f7784edc5c22d9f5c35f38fc (diff)
Fix a bug in run_tool_with_logging script
Fix the case when call a tool with run_tool_with_logging with a single arg start with -- (e.g. adb --help), make sure when we pass that arg to the logger, it treat it as the value for the --tool_args option instead of a separate option Test: atest run_tool_with_logging_test Test: manually run source build/envsetup.sh and run adb --help and check the event log is sent to clearcut. Tested with both bash and zsh Bug: 341382247 Change-Id: I1e09907f267b453cb62876e171064daa021e3d91
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/envsetup.sh b/envsetup.sh
index b20c83fed3..640ed149e6 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -847,11 +847,11 @@ function run_tool_with_logging() {
# Remove the trap to prevent duplicate log.
trap - EXIT;
"${logger}" \
- --tool_tag "${tool_tag}" \
- --start_timestamp "${start_time}" \
- --end_timestamp "$(date +%s.%N)" \
- --tool_args "$*" \
- --exit_code "${exit_code}" \
+ --tool_tag="${tool_tag}" \
+ --start_timestamp="${start_time}" \
+ --end_timestamp="$(date +%s.%N)" \
+ --tool_args="$*" \
+ --exit_code="${exit_code}" \
${ANDROID_TOOL_LOGGER_EXTRA_ARGS} \
> /dev/null 2>&1 &
exit ${exit_code}