setupvars.sh: ignore cd output (#20657)

* `setupvars.sh`: ignore `cd` output

Having `function cd() { builtin cd "$@" && l; }` defined in bash breaks `setupvars.sh`

* Use `builtin cd` to enable `function cd() { builtin cd "$@" && l; }`, remove wrapping `echo $()` because `pwd` already prints
This commit is contained in:
Zlobin Vladimir
2023-11-13 16:15:30 +04:00
committed by GitHub
parent 0125c89738
commit f97e7f1c9d

View File

@@ -6,7 +6,8 @@
abs_path () {
script_path=$(eval echo "$1")
directory=$(dirname "$script_path")
echo "$(cd "$directory" || exit; pwd -P)";
builtin cd "$directory" || exit
pwd -P
}
SCRIPT_DIR="$(abs_path "${BASH_SOURCE[0]}")" >/dev/null 2>&1