run-build.sh: use actual exit code ($?)

The parameter passed to `exit` was always 0 (exit code of previous `echo` call). It seems to me that the intention is to terminate the script with the actual exit error code (!= 0).
This commit is contained in:
Rikard Johansson 2017-04-11 07:11:27 +02:00 committed by GitHub
parent 5e9e688d9e
commit cd200fabd3

View file

@ -166,18 +166,19 @@ if [ ! -f $bootStrapperPath ]; then
fi fi
$bootStrapperPath --dotNetInstallBranch master --repositoryRoot "$REPOROOT" --toolsLocalPath "$toolsLocalPath" --cliInstallPath $DOTNET_INSTALL_DIR_PJ --architecture $ARCHITECTURE > bootstrap.log $bootStrapperPath --dotNetInstallBranch master --repositoryRoot "$REPOROOT" --toolsLocalPath "$toolsLocalPath" --cliInstallPath $DOTNET_INSTALL_DIR_PJ --architecture $ARCHITECTURE > bootstrap.log
EXIT_CODE=$?
if [ $? != 0 ]; then if [ $EXIT_CODE != 0 ]; then
echo "run-build: Error: Boot-strapping failed with exit code $?, see bootstrap.log for more information." >&2 echo "run-build: Error: Boot-strapping failed with exit code $EXIT_CODE, see bootstrap.log for more information." >&2
exit $? exit $EXIT_CODE
fi fi
# now execute the script # now execute the script
echo "installing CLI: $dotnetInstallPath --channel \"master\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\" $LINUX_PORTABLE_INSTALL_ARGS" echo "installing CLI: $dotnetInstallPath --channel \"master\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\" $LINUX_PORTABLE_INSTALL_ARGS"
$dotnetInstallPath --channel "master" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS $dotnetInstallPath --channel "master" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS
if [ $? != 0 ]; then EXIT_CODE=$?
echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $?." >&2 if [ $EXIT_CODE != 0 ]; then
exit $? echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $EXIT_CODE." >&2
exit $EXIT_CODE
fi fi
# Put stage 0 on the PATH (for this shell only) # Put stage 0 on the PATH (for this shell only)