Permalink
Browse files

Merge branch 'master' of https://github.com/directionless/rvm

Fix #461

Conflicts:
	binscripts/rvm
  • Loading branch information...
mpapis committed Sep 29, 2011
2 parents 94387e8 + 207f003 commit 9e5adb16dcc382343427e34f94421a917249794d
Showing with 17 additions and 5 deletions.
  1. +17 −5 binscripts/rvm
View
@@ -21,17 +21,29 @@ then
done
fi
+export rvm_path
if [[ -z "${rvm_path:-}" ]]
then
if (( UID == 0 ))
then
rvm_path="/usr/local/rvm"
- else
+ elif [[ -d "${HOME}/.rvm" ]]
+ then
rvm_path="${HOME}/.rvm"
+ elif [[ -d "/usr/local/rvm" ]]
+ then
+ rvm_path="/usr/local/rvm"
+ else
+ echo "Can't find rvm install!" 1>&2
+ exit 1
fi
fi
-export rvm_path
-
-source "${rvm_scripts_path:="$rvm_path/scripts"}/rvm"
-rvm "$@"
+# if to prevent fork-bomb
+if source "${rvm_scripts_path:="$rvm_path/scripts"}/rvm"
+then
+ rvm "$@"
+else
+ echo "Error sourcing RVM!" 1>&2
+ exit 1
+fi

0 comments on commit 9e5adb1

Please sign in to comment.