Don't exit prebuild script on nonzero exit code when we already check it

We have `set -e` enabled, so normally exit the script if a command fails.
We also had explicit exit code checks in a few places with user-friendly
error messages. These were never printed as the script exited before we
could check the exit code due to a bad exit code.
pull/2911/head
AnyOldName3 5 years ago
parent 87dba1fcfc
commit a6493ce329

@ -213,8 +213,8 @@ run_cmd() {
shift
if [ -z $VERBOSE ]; then
eval $CMD $@ > output.log 2>&1
RET=$?
RET=0
eval $CMD $@ > output.log 2>&1 || RET=$?
if [ $RET -ne 0 ]; then
if [ -z $APPVEYOR ]; then
@ -230,8 +230,9 @@ run_cmd() {
return $RET
else
eval $CMD $@
return $?
RET=0
eval $CMD $@ || RET=$?
return RET
fi
}
@ -256,15 +257,16 @@ download() {
printf " Downloading $FILE... "
if [ -z $VERBOSE ]; then
curl --silent --retry 10 -kLy 5 -o $FILE $URL
RET=$?
RET=0
curl --silent --retry 10 -kLy 5 -o $FILE $URL || RET=$?
else
curl --retry 10 -kLy 5 -o $FILE $URL
RET=$?
RET=0
curl --retry 10 -kLy 5 -o $FILE $URL || RET=$?
fi
if [ $RET -ne 0 ]; then
echo "Failed!"
wrappedExit $RET
else
echo "Done."
fi
@ -997,8 +999,8 @@ if [ -z $VERBOSE ]; then
else
echo "- cmake .. $CMAKE_OPTS"
fi
run_cmd cmake .. $CMAKE_OPTS
RET=$?
RET=0
run_cmd cmake .. $CMAKE_OPTS || RET=$?
if [ -z $VERBOSE ]; then
if [ $RET -eq 0 ]; then
echo Done.
@ -1006,6 +1008,9 @@ if [ -z $VERBOSE ]; then
echo Failed.
fi
fi
if [ $RET -ne 0 ]; then
wrappedExit $RET
fi
if [ -n $ACTIVATE_MSVC ]; then
echo

Loading…
Cancel
Save