Permalink
Browse files

Bugfix: Working function load test for both sh and bash/zsh.

  • Loading branch information...
1 parent 4147085 commit a5dfe49784b43213d52160088e9951c1f1c9fb17 @wayneeseguin wayneeseguin committed Nov 15, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 scripts/rvm
View
8 scripts/rvm
@@ -4,8 +4,12 @@
# http://rvm.beginrescueend.com
# http://github.com/wayneeseguin/rvm
-declare -f | \grep -q '^rvm ()' # Is RVM is a shell function?
-
+# Is RVM loaded as a shell function already?
+if [[ -n "$BASH_VERSION" || "$ZSH_VERSION" ]] ; then
+ \grep -q '^rvm ()' < <(declare -f)
+else
+ declare -f | \grep -q '^rvm ()'
+fi
if [[ $? -gt 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then
if [[ ${rvm_ignore_rvmrc:-0} -eq 0 ]]; then

0 comments on commit a5dfe49

Please sign in to comment.