1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

ctdb-tests: Avoid shellcheck warning SC2164

SC2164 Use 'cd ... || exit' or 'cd ... || return' in case cd fails

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2019-08-05 10:12:23 +10:00 committed by Amitay Isaacs
parent 83f73b5abc
commit 034f4cfab8

View File

@ -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.