Load RVM and auto-completion is available
authorTravis Swicegood <development@domain51.com>
Mon, 30 May 2011 14:46:22 +0000 (09:46 -0500)
committerTravis Swicegood <development@domain51.com>
Mon, 30 May 2011 14:46:22 +0000 (09:46 -0500)
No reason not to turn on RVM if it's present and the autocompletion is a
huge benefit.

plugins/available/rvm.plugin.bash

index d3c81ed..97f0214 100644 (file)
@@ -1,4 +1,14 @@
 #!/bin/bash
+
+# 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.
+if [ "$rvm_path" ]
+then
+    [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
+fi
+
 switch () {
   rvm $1
   local v=$(rvm_version)