From 30687c414785fbc7d7d7d44ae60166075be75da7 Mon Sep 17 00:00:00 2001 From: Alexander Simonov Date: Sun, 22 May 2011 01:31:11 +0200 Subject: [PATCH] Fix RVM loading and RVM ruby version info --- lib/rvm.zsh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/rvm.zsh b/lib/rvm.zsh index cb870a9b..a0a48960 100644 --- a/lib/rvm.zsh +++ b/lib/rvm.zsh @@ -1,5 +1,11 @@ -# get the name of the branch we are on +# load RVM +[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm + +# get the name of the ruby version function rvm_prompt_info() { - ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return - [[ ! -z $ruby_version ]] && echo "($ruby_version)" + [ -f $HOME/.rvm/bin/rvm-prompt ] || return + local rvm_prompt + rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null) + [[ "${rvm_prompt}x" == "x" ]] && return + echo "$ZSH_THEME_RVM_PROMPT_PREFIX$rvm_prompt$ZSH_THEME_RVM_PROMPT_SUFFIX" }