-
-
Save rud/233676 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: to use, you'll also need to place something like this in your precmd function: | |
# findrvm $PWD | |
# recursively search parent directories to see if there's a .rvm file | |
findrvm () { | |
if [[ -f "$1/.rvm" ]]; then | |
current_rvm=`basename $GEM_HOME` | |
dot_rvm=`cat $1/.rvm` | |
if [[ dot_rvm != current_rvm ]]; then #cat $1/.rvm | |
rvm `cat $1/.rvm` | |
fi | |
return | |
elif [[ $1 = / ]]; then | |
return | |
fi | |
current=`dirname $1` | |
findrvm $current | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment