Created
April 5, 2010 18:26
-
-
Save rbriank/356682 to your computer and use it in GitHub Desktop.
simple rvm version switcher
This file contains 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
# add a .rvm file to APP_ROOT containing only the version | |
# e.g. 1.9.1 | |
# add this to your .bashrc file | |
cd () { | |
command cd "$@"; | |
if [ -f ./.rvm ]; then | |
version=`cat ./.rvm` | |
if [ `ruby -v | grep -c $version` == 0 ]; then | |
rvm $version | |
echo "switched to ruby $version" | |
fi | |
fi | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment