From f50d9dc23d11b028b75b0fa544fe9aed23def9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Ferreira?= Date: Thu, 27 Aug 2020 18:10:50 +0100 Subject: [PATCH] server: build: make script safer by failing on pipes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bash shell normally only looks at the exit code of the last command of a pipeline. This behavior is not ideal as it causes the -e option to only be able to act on the exit code of a pipeline’s last command. This is where -o pipefail comes in. This particular option sets the exit code of a pipeline to that of the rightmost command to exit with a non-zero status, or to zero if all commands of the pipeline exit successfully. See more about safer bash scripts: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ Signed-off-by: Luís Ferreira --- server/build_without_gradle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/build_without_gradle.sh b/server/build_without_gradle.sh index 6b0246ae..40f3ee86 100755 --- a/server/build_without_gradle.sh +++ b/server/build_without_gradle.sh @@ -9,7 +9,7 @@ # # BUILD_DIR=my_build_dir ./build_without_gradle.sh -set -e +set -eo pipefail SCRCPY_DEBUG=false SCRCPY_VERSION_NAME=1.16