Use command -v
instead of which
in conditionals
Reason: https://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212
This commit is contained in:
parent
24634ada70
commit
9aa2cd5026
2 changed files with 2 additions and 2 deletions
|
@ -100,7 +100,7 @@ Your `~/.vimrc.local` might look like this:
|
|||
Your `~/.zshenv.local` might look like this:
|
||||
|
||||
# load pyenv if available
|
||||
if which pyenv &>/dev/null ; then
|
||||
if command -v pyenv &>/dev/null ; then
|
||||
eval "$(pyenv init -)"
|
||||
fi
|
||||
|
||||
|
|
2
zshenv
2
zshenv
|
@ -6,7 +6,7 @@ export EDITOR=$VISUAL
|
|||
export PATH="$HOME/.bin:/usr/local/sbin:$PATH"
|
||||
|
||||
# load rbenv if available
|
||||
if which rbenv &>/dev/null ; then
|
||||
if command -v rbenv &>/dev/null ; then
|
||||
eval "$(rbenv init - --no-rehash)"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue