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 .".
This commit is contained in:
Johannes Altmanninger 2021-04-17 21:57:29 +02:00
parent b3c520cc47
commit d96a2e7052

View file

@ -16,7 +16,7 @@ DOCKER_EXTRA_ARGS=""
set -e set -e
# Get fish source directory. # 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. # Parse args.
while [ $# -gt 1 ]; do while [ $# -gt 1 ]; do