From: Martin Schwenke Date: Mon, 5 Aug 2019 00:12:23 +0000 (+1000) Subject: ctdb-tests: Avoid shellcheck warning SC2164 X-Git-Tag: tdb-1.4.2~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=034f4cfab8b6690e07f5b9cfaaa5cb31ac29336e;p=thirdparty%2Fsamba.git ctdb-tests: Avoid shellcheck warning SC2164 SC2164 Use 'cd ... || exit' or 'cd ... || return' in case cd fails Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index 087eae4257b..5d2d3ff560b 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -300,7 +300,10 @@ for f in "${tests[@]}" ; do if [ $status -eq 127 ] ; then # Find the the top-level tests directory - d=$(cd "$TEST_SCRIPTS_DIR"; echo "$PWD") + d=$(cd "$TEST_SCRIPTS_DIR" && echo "$PWD") + if [ -z "$d" ] ; then + die "Unable to find TEST_SCRIPTS_DIR=\"${TEST_SCRIPTS_DIR}\"" + fi tests_dir=$(dirname "$d") # Strip off current directory from beginning, if there, just # to make paths more friendly.