Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

script vs run logic.

  • Loading branch information...
commit 46779a15f8988d0292682ef6ed89eb2b22466c00 1 parent bb3f61d
@wayneeseguin wayneeseguin authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 scripts/rvm
View
10 scripts/rvm
@@ -4,7 +4,10 @@
# http://rvm.beginrescueend.com
# http://gitub.com/wayneeseguin/rvm
-if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
+# Determine if we were called or sourced... under assumption of course ;)
+if [[ $# -gt 0 ]] && [[ -z "$(echo "$*" | awk '/completion-/')" ]] && [[ "$(basename $0)" = "rvm" ]] ; then run=1 ; fi
+
+if [[ "$run" -eq 1 ]] || [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
if [[ ! -z "$rvm_reload_flag" ]] ; then
unset rvm_reload_flag
while [[ $# -gt 0 ]] ; do shift ; done
@@ -43,8 +46,5 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
if [[ -f "$rvm_path/default" ]] ; then source "$rvm_path/default" ; fi
fi
-# Ok now we determine if we were called or sourced... under assumption of course ;)
-if [[ $# -gt 0 ]] && [[ -z "$(echo "$*" | awk '/completion-/')" ]] && [[ "$(basename $0)" = "rvm" ]] ; then
- rvm "$*"
-fi
+if [[ "$run" -eq 1 ]] ; then rvm "$*" ; fi
Please sign in to comment.
Something went wrong with that request. Please try again.