install in rvm-1.0.7 vs install in rvm-1.0.8

- old
+ new

@@ -192,13 +192,10 @@ item="* " question="\n<?>" cwd="$PWD" source_path="${source_path:-$cwd}" -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"}" if [[ "$rvm_selfcontained" = "0" ]] ; then rvm_bin_path="${rvm_bin_path:-"${rvm_prefix}bin"}" rvm_man_path="${rvm_man_path:-"${rvm_prefix}share/man"}" rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}" @@ -207,13 +204,10 @@ rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}" rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}" fi rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}" -rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}" -rvm_config_path="${rvm_config_path:-"$rvm_path/config"}" -rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}" rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}" printf " RVM: Shell scripts enabling management of multiple ruby environments. RTFM: http://rvm.beginrescueend.com/ @@ -228,22 +222,26 @@ printf "\nInstalling RVM to $rvm_path/" fi -for directory in "$rvm_archives_path" "$rvm_src_path" "$rvm_log_path" "$rvm_bin_path" "$rvm_gems_path" "$rvm_rubies_path" "$rvm_config_path" "$rvm_hooks_path" "$rvm_tmp_path" ; do +directories=( "${rvm_archives_path:-"$rvm_path/archives"}" "${rvm_src_path:-"$rvm_path/src"}" "${rvm_log_path:-"$rvm_path/log"}" "$rvm_bin_path" "${rvm_gems_path:-"$rvm_path/gems"}" "${rvm_rubies_path:-"$rvm_path/rubies"}" "$rvm_path/config" "${rvm_tmp_path:-"$rvm_path/tmp"}" ) +for directory in "${directories[@]}" ; do + if [[ ! -d "$directory" ]] ; then mkdir -p "$directory" fi done -for file in README LICENCE ; do +files=(README LICENCE) +for file in "${files[@]}"; do + cp -f "$source_path/$file" "$rvm_path/" done # @@ -263,12 +261,12 @@ fi done -if [[ ! -s "$rvm_config_path/user" ]] ; then - echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_config_path/user" +if [[ ! -s "$rvm_path/config/user" ]] ; then + echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_path/config/user" fi scripts=(monitor match log install color db fetch log set package) for script_name in "${scripts[@]}" ; do @@ -279,19 +277,21 @@ # # Bin Scripts # # Cleanse and purge... -for file in rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby ; do +files=(rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby) +for file in "${files[@]}" ; do + rm -f "$rvm_bin_path/$file" - cp -f "$source_path/binscripts/$file" $rvm_bin_path/ + cp -f "$source_path/binscripts/$file" "${rvm_bin_path:-"$rvm_path/bin"}/" done -chmod +x "$rvm_bin_path"/* # TODO: this is quite suboptimal. +chmod +x "${rvm_bin_path:-"$rvm_path/bin"}"/* # TODO: this is quite suboptimal. # # RC Files # if [[ -n "$rvm_auto_flag" ]] ; then @@ -387,21 +387,19 @@ fi # # Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0. # -rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}" +mkdir -p "${rvm_rubies_path:-"$rvm_path/rubies"}/" -mkdir -p "$rvm_rubies_path/" - for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do if [[ -d "$ruby" ]] ; then - mv "$ruby" "$rvm_rubies_path/" + mv "$ruby" "${rvm_rubies_path:-"$rvm_path/rubies"}/" - new_path="$rvm_rubies_path/$(basename $ruby)" + new_path="${rvm_rubies_path:-"$rvm_path/rubies"}/$(basename $ruby)" for file in gem rake ; do if [[ -s "$new_path/bin/$file" ]] ; then @@ -466,33 +464,33 @@ fi done # Move from legacy defaults to the new, alias based system. -if [[ -s "$rvm_config_path/default" ]]; then +if [[ -s "$rvm_path/config/default" ]]; then - original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")" + original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")" if [[ -n "$original_version" ]]; then "$rvm_path/scripts/alias" create default "$original_version" &> /dev/null fi ; unset original_version - rm -rf "$rvm_config_path/default" + rm -rf "$rvm_path/config/default" fi # # End of gemset migration. # printf "\n Correct permissions for base binaries in $rvm_bin_path..." -mkdir -p "$rvm_bin_path" +mkdir -p "${rvm_bin_path:-"$rvm_path/bin"}" for file in rvm rvmsudo rvm-shell rvm-auto-ruby ; do - [[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file" + [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] && chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file" done printf "\n Copying manpages into place."