scripts/rvm in rvm-0.0.80 vs scripts/rvm in rvm-0.0.81

- old
+ new

@@ -4,50 +4,36 @@ # rvm : Ruby Version Manager # http://rvm.beginrescueend.com # http://gitub.com/wayneeseguin/rvm # -if [[ -f "/etc/rvmrc" ]] ; then source "/etc/rvmrc" ; fi +if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi +if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi +if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi if [[ "root" = "$(whoami)" ]] ; then - rvm_prefix_path="${rvm_prefix_path:-/usr/local/}" + rvm_path="${rvm_path:-/usr/local/rvm}" else - 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 + rvm_path="${rvm_path:-$HOME/.rvm}" 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/initialize +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 alias rvm-restart="source \"${rvm_path}/scripts/rvm\"" if [[ -f "$rvm_path/default" ]] ; then source "$rvm_path/default" ; fi -# Ok now we determine if we were called or sourced... under assumption of course ;) -if [[ $# -gt 0 ]] && [[ -z "$(echo "$*" | awk '/completion-/')" ]] ; then rvm "$*" ; fi - # Source a .rvmrc file in a directory after changing to it, if it exists. cd() { builtin cd "$@" ; if [[ -f .rvmrc ]] ; then source .rvmrc ; fi ; } + +# Ok now we determine if we were called or sourced... under assumption of course ;) +if [[ $# -gt 0 ]] && [[ -z "$(echo "$*" | awk '/completion-/')" ]] ; then rvm "$*" ; fi