diff --git a/autoninja b/autoninja index 9e64c30bcd..d6e065f12d 100755 --- a/autoninja +++ b/autoninja @@ -10,7 +10,13 @@ command=$(python $(dirname -- "$0")/autoninja.py "$@") echo $command $command -if [ $? -eq 0 ] && [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then - python $(dirname -- "$0")/post_build_ninja_summary.py $@ +if [ $? -eq 0 ]; then + if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then + python $(dirname -- "$0")/post_build_ninja_summary.py $@ + fi + exit fi +# Return an error code of 1 so that if a developer types: +# "autoninja chrome && chrome" then chrome won't run if the build fails. +exit 1 diff --git a/autoninja.bat b/autoninja.bat index 5e1b6fe7c0..a071fb96ec 100755 --- a/autoninja.bat +++ b/autoninja.bat @@ -8,4 +8,8 @@ REM Also print it to reassure that the right settings are being used. FOR /f "usebackq tokens=*" %%a in (`python %~dp0autoninja.py "%*"`) do echo %%a & %%a @if errorlevel 1 goto buildfailure @if "%NINJA_SUMMARIZE_BUILD%" == "1" python %~dp0post_build_ninja_summary.py %* +exit /b :buildfailure +REM Return an error code of 1 so that if a developer types: +REM "autoninja chrome && chrome" then chrome won't run if the build fails. +cmd /c exit 1