From d96a2e70520773143c7f2cdd573a019cbf6766b9 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 17 Apr 2021 21:57:29 +0200 Subject: [PATCH] Make docker script work when CDPATH is set Since #3914 we convert empty CDPATH entries to ".", which makes them easier to use in fish scripts. This has backfired here, because bash's cd prints the directory if the "." entry from CDPATH is used. From bash(1) on cd: > If a non-empty directory name from CDPATH is used, or if - is > the first argument, and the directory change is successful, the > absolute pathname of the new working directory is written to the > standard output. My preferred fix would be to convince bash to amend "non-empty directory" to "non-empty directory other than .". --- docker/docker_run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker_run_tests.sh b/docker/docker_run_tests.sh index a4adb8b36..86c171fbc 100755 --- a/docker/docker_run_tests.sh +++ b/docker/docker_run_tests.sh @@ -16,7 +16,7 @@ DOCKER_EXTRA_ARGS="" set -e # Get fish source directory. -FISH_SRC_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd) +FISH_SRC_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )"/.. >/dev/null && pwd) # Parse args. while [ $# -gt 1 ]; do