1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 13:19:40 +00:00

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.
This commit is contained in:
AnyOldName3 2020-06-13 01:51:27 +01:00
parent 87dba1fcfc
commit a6493ce329

View file

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