From 8bf178f0560fc5524cb0265b38e2387c78552bf8 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Mon, 30 May 2022 09:34:57 +0100 Subject: [PATCH] Use set -e in Bash scripts Ensures they stop if an intermediate command fails, rather than trucking on without a care in the world. --- build/build-linux.sh | 6 +++--- build/build-macos.sh | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/build-linux.sh b/build/build-linux.sh index c5a9ea9..295ed85 100755 --- a/build/build-linux.sh +++ b/build/build-linux.sh @@ -1,11 +1,12 @@ #!/bin/bash +set -euo pipefail cd "$(dirname "$0")" # Get the git commit / branch and write it into build.py. build_commit="$(git rev-parse --short HEAD)" build_branch="$(git branch --show-current)" -echo "BUILD: str = \"$build_commit\"" > ../build.py -echo "BRANCH: str = \"$build_branch\"" >> ../build.py +echo "BUILD: str = \"$build_commit\"" >../build.py +echo "BRANCH: str = \"$build_branch\"" >>../build.py sudo apt install libportaudio2 sudo apt install python3-pip python3-venv ffmpeg @@ -29,4 +30,3 @@ bash ./build-exe-pyinstaller-command.sh rm ./*.spec rm ../build.py - diff --git a/build/build-macos.sh b/build/build-macos.sh index 1648b57..a28f323 100755 --- a/build/build-macos.sh +++ b/build/build-macos.sh @@ -1,11 +1,12 @@ #!/bin/bash +set -euo pipefail cd "$(dirname "$0")" # Get the git commit / branch and write it into build.py. build_commit="$(git rev-parse --short HEAD)" build_branch="$(git branch --show-current)" -echo "BUILD: str = \"$build_commit\"" > ../build.py -echo "BRANCH: str = \"$build_branch\"" >> ../build.py +echo "BUILD: str = \"$build_commit\"" >../build.py +echo "BRANCH: str = \"$build_branch\"" >>../build.py python3 -m venv ../venv source ../venv/bin/activate @@ -13,8 +14,7 @@ source ../venv/bin/activate pip3 install wheel pip3 install -r requirements.txt pip3 install -r requirements-macos.txt -pip3 install -e ..\ - +pip3 install -e .. python3 ./generate-build-exe-config.py python3 ./build-exe.py