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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user