Merge pull request #52 from tswicegood/rvm-enhancements
Optimize how RVM is loaded and add RVM auto completion.pull/51/merge
commit
13d7c76087
|
|
@ -1,16 +1,29 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
switch () {
|
|
||||||
|
# Load RVM, if you are using it
|
||||||
|
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
switch () {
|
||||||
rvm $1
|
rvm $1
|
||||||
local v=$(rvm_version)
|
local v=$(rvm_version)
|
||||||
rvm wrapper $1 textmate
|
rvm wrapper $1 textmate
|
||||||
echo "Switch to Ruby version: "$v
|
echo "Switch to Ruby version: "$v
|
||||||
}
|
}
|
||||||
|
|
||||||
rvm_default () {
|
rvm_default () {
|
||||||
rvm --default $1
|
rvm --default $1
|
||||||
rvm wrapper $1 textmate
|
rvm wrapper $1 textmate
|
||||||
}
|
}
|
||||||
|
|
||||||
function rvm_version () {
|
function rvm_version () {
|
||||||
ruby --version
|
ruby --version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue