Commit c3a48f9d authored by Bruce Dawson's avatar Bruce Dawson Committed by LUCI CQ

Make autoninja.py handle git bash better

If autoninja.py detects that goma is not running when it should be then
it prints 'cmd /c exit 1' as the command to be run. This ensures that
errorlevel will be set so that the failure will be detected.
Unfortunately this doesn't work when running autoninja from git bash.
Instead of launching a cmd.exe instance which immediately exits, it
launches a cmd.exe instance which the user must manually exit.

This change adds quotes so that this works from git bash (which invokes
the shell script) as well as from cmd.exe (invoking the batch file).

Bug: 868590
Change-Id: I482f22830f9bd4f7b70c51de9647a70d946ec145
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2726085Reviewed-by: 's avatarJoe Mason <joenotcharles@chromium.org>
Reviewed-by: 's avatarBruce Dawson <brucedawson@chromium.org>
Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
Owners-Override: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
parent ec3c3953
......@@ -132,7 +132,7 @@ if use_goma:
file=sys.stderr)
if sys.platform.startswith('win'):
# Set an exit code of 1 in the batch file.
print('cmd /c exit 1')
print('cmd "/c exit 1"')
else:
# Set an exit code of 1 by executing 'false' in the bash script.
print('false')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment