From f057715a3049e79d991e593a0e965a0772b58fbc Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Sat, 19 Sep 2015 15:03:44 -0400 Subject: [PATCH] Use command -v instead of which. https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then --- bullet-train.zsh-theme | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 441bf30..d32dcb9 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -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 }