Skip to content

Commit

Permalink
cause build.sh to exit if pio tasks fail
Browse files Browse the repository at this point in the history
  • Loading branch information
markjfisher committed Sep 24, 2024
1 parent a1c72d6 commit 78e4c01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function show_help {
echo " ./build.sh -cb # for CLEAN + BUILD of current target in platformio-local.ini"
echo " ./build.sh -m # View FujiNet Monitor"
echo " ./build.sh -cbum # Clean/Build/Upload to FN/Monitor"
echo " ./build.sh -f # Upload filesystem"
echo ""
echo "Supported boards:"
echo ""
Expand Down Expand Up @@ -161,6 +162,10 @@ if [ ! -z "$PC_TARGET" ] ; then
else
cmake "$GEN_CMD" .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DFUJINET_TARGET=$PC_TARGET "$@"
fi
if [ $? -ne 0 ]; then
echo "cmake failed writing compile commands. Exiting"
exit 1
fi
# Run the specific build
BUILD_TYPE="Release"
if [ $DEBUG_PC_BUILD -eq 1 ] ; then
Expand Down Expand Up @@ -303,6 +308,10 @@ if [ ${AUTOCLEAN} -eq 0 ] ; then
AUTOCLEAN_ARG="--disable-auto-clean"
fi

# any stage that fails from this point should stop the script immediately, as they are designed to run
# on from each other sequentially as long as the previous passed.
set -e

if [ ${RUN_BUILD} -eq 1 ] ; then
pio run -c $INI_FILE ${DEV_MODE_ARG} $ENV_ARG $TARGET_ARG $AUTOCLEAN_ARG 2>&1
fi
Expand Down

0 comments on commit 78e4c01

Please sign in to comment.