bin_path(): use builtin commands and avoid which
This commit is contained in:
@@ -13,4 +13,11 @@ function fail_if_not_git_repo() {
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
bin_path() {
|
||||
if [[ -n ${ZSH_VERSION:-} ]];
|
||||
then builtin whence -cp "$1" 2> /dev/null
|
||||
else builtin type -P "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user