From: Travis Swicegood Date: Mon, 30 May 2011 14:52:30 +0000 (-0500) Subject: Make sure that RVM is loaded before defining extras X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=b740d7f0f731e9029720d012c289dd00056120f1;p=common%2Fbash_it.git Make sure that RVM is loaded before defining extras --- diff --git a/plugins/available/rvm.plugin.bash b/plugins/available/rvm.plugin.bash index 97f0214..e158a80 100644 --- a/plugins/available/rvm.plugin.bash +++ b/plugins/available/rvm.plugin.bash @@ -3,24 +3,27 @@ # Load RVM, if you are using it [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm -# Load the auto-completion script if RVM was loaded. +# Check to make sure that RVM is actually loaded before adding +# the customizations to it. if [ "$rvm_path" ] then + # Load the auto-completion script if RVM was loaded. [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion -fi -switch () { - rvm $1 - local v=$(rvm_version) - rvm wrapper $1 textmate - echo "Switch to Ruby version: "$v -} + switch () { + rvm $1 + local v=$(rvm_version) + rvm wrapper $1 textmate + echo "Switch to Ruby version: "$v + } + + rvm_default () { + rvm --default $1 + rvm wrapper $1 textmate + } -rvm_default () { - rvm --default $1 - rvm wrapper $1 textmate -} + function rvm_version () { + ruby --version + } -function rvm_version () { - ruby --version -} \ No newline at end of file +fi