mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 20:00:38 +01:00
Use command -v instead of which.
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then
This commit is contained in:
@@ -342,14 +342,14 @@ prompt_ruby() {
|
||||
return
|
||||
fi
|
||||
|
||||
if which rvm-prompt &> /dev/null; then
|
||||
if command -v rvm-prompt > /dev/null 2>&1; then
|
||||
if [[ ! -n $(rvm gemset list | grep "=> (default)") ]]
|
||||
then
|
||||
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rvm-prompt i v g)"
|
||||
fi
|
||||
elif which chruby &> /dev/null; then
|
||||
elif command -v chruby > /dev/null 2>&1; then
|
||||
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(chruby | sed -e 's/ \* //')"
|
||||
elif which rbenv &> /dev/null; then
|
||||
elif command -v rbenv > /dev/null 2>&1; then
|
||||
prompt_segment $BULLETTRAIN_RUBY_BG $BULLETTRAIN_RUBY_FG $BULLETTRAIN_RUBY_PREFIX" $(rbenv version | sed -e 's/ (set.*$//')"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user