From f436143be17e7b59b8672f0da6431209509a95cd Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 26 May 2020 15:22:58 +0200 Subject: [PATCH] ci: address ShellCheck issues in prepare.sh In ./prepare.sh line 21: if [ $? -ne 0 ] ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In ./prepare.sh line 28: eval set -- ${opts} ^-----^ SC2086: Double quote to prevent globbing and word splitting. In ./prepare.sh line 55: echo ${ref} ^----^ SC2086: Double quote to prevent globbing and word splitting. In ./prepare.sh line 69: git clone --depth=1 ${gitrepo} ${workdir} ^--------^ SC2086: Double quote to prevent globbing and word splitting. ^--------^ SC2086: Double quote to prevent globbing and word splitting. In ./prepare.sh line 70: cd ${workdir} ^-----------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^--------^ SC2086: Double quote to prevent globbing and word splitting. Signed-off-by: Niels de Vos --- prepare.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prepare.sh b/prepare.sh index cde460159..0d53e7623 100755 --- a/prepare.sh +++ b/prepare.sh @@ -17,8 +17,9 @@ opts=$(getopt \ --options "" \ -- "$@" ) +ret=$? -if [ $? -ne 0 ] +if [ ${ret} -ne 0 ] then echo "Try '--help' for more information." exit 1