Skip to content

Commit

Permalink
Moved scripts detection code, added defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Jan 31, 2010
1 parent ffb99ea commit 1b5c55a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
8 changes: 0 additions & 8 deletions scripts/initialize
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ if [[ ! -z "$rvm_archflags" ]] ; then rvm_make_flags_flag=1 ; fi
rvm_project_rvmrc="${rvm_project_rvmrc:-1}"
rvm_project_rvmrc_default="${rvm_project_rvmrc_default:-0}"

if [[ -z "$rvm_scripts_path" ]] ; then
if [[ -d "$HOME/.rvm/scripts" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
rvm_scripts_path="$HOME/.rvm/scripts"
elif [[ -d "$rvm_path/scripts" ]] && [[ -s "$rvm_path/scripts/rvm" ]]; then
rvm_scripts_path="$rvm_path/scripts"
fi
fi

rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
Expand Down
17 changes: 15 additions & 2 deletions scripts/rvm
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,28 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
fi
fi
fi

if [[ -z "$rvm_scripts_path" ]] || [[ ! -d "$rvm_scripts_path" ]] ; then
if [[ -d "$HOME/.rvm/scripts" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
rvm_scripts_path="$HOME/.rvm/scripts"
elif [[ -d "$rvm_path/scripts" ]] && [[ -s "$rvm_path/scripts/rvm" ]]; then
rvm_scripts_path="$rvm_path/scripts"
else
if [[ "root" = "$(whoami)" ]] ; then
rvm_scripts_path="/usr/local/rvm"
else
rvm_scripts_path="$HOME/.rvm"
fi
fi
fi

if [[ -d "$rvm_path" ]] ; then
rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"
source $rvm_scripts_path/array
source $rvm_scripts_path/utility
source $rvm_scripts_path/initialize
source $rvm_scripts_path/version
source $rvm_scripts_path/selector
source $rvm_scripts_path/cli
#source $rvm_scripts_path/gems
source $rvm_scripts_path/libraries
source $rvm_scripts_path/cd

Expand Down

0 comments on commit 1b5c55a

Please sign in to comment.