scripts/rvm in rvm-0.0.75 vs scripts/rvm in rvm-0.0.76
- old
+ new
@@ -4,27 +4,39 @@
# rvm : Ruby Version Manager
# http://rvm.beginrescueend.com
# http://gitub.com/wayneeseguin/rvm
#
+if [[ -f "/etc/rvmrc" ]] ; then source "/etc/rvmrc" ; fi
+
if [[ "root" = "$(whoami)" ]] ; then
rvm_prefix_path="${rvm_prefix_path:-/usr/local/}"
else
- rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
+ if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
+ if [[ -f "$HOME/.rvm/scripts/rvm" ]] ; then
+ rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
+ elif [[ -f "/usr/local/rvm/scripts/rvm" ]] ; then
+ rvm_scripts_path="${rvm_scripts_path:-"/usr/local/rvm"}"
+ rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
+ else
+ echo -e "\nERROR: rvm scripts directory was not found in either ~/.rvm/ or /usr/local/rvm\n"
+ if [[ $# -gt 0 ]] ; then exit 0 ; else return 1 ; fi
+ fi
fi
if [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '.' ]] || [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '/' ]] ; then
rvm_path="${rvm_prefix_path}rvm"
else
rvm_path="${rvm_prefix_path}/rvm"
fi
-source $rvm_path/scripts/color
-source $rvm_path/scripts/utility
-source $rvm_path/scripts/selector
-source $rvm_path/scripts/ruby-installer # TODO: Script not function.
-source $rvm_path/scripts/cli
-source $rvm_path/scripts/gems
+rvm_scripts_path="${rvm_scripts_path:-$rvm_path}"
+source $rvm_scripts_path/scripts/color
+source $rvm_scripts_path/scripts/utility
+source $rvm_scripts_path/scripts/selector
+source $rvm_scripts_path/scripts/ruby-installer # TODO: Script not function.
+source $rvm_scripts_path/scripts/cli
+source $rvm_scripts_path/scripts/gems
rvm_loaded_flag=1 ; export rvm_loaded_flag
rvm_version="$(cat "${rvm_path}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')" ; export rvm_version