install in rvm-1.0.1 vs install in rvm-1.0.2

- old
+ new

@@ -74,11 +74,11 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi source scripts/initialize -if \grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || \grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then +if \grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null || \grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null; then if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then export upgrade_flag=1 else export upgrade_flag=0 fi @@ -91,11 +91,11 @@ # # Setup & Configuration # item="$(tput setaf 2)* $(tput sgr0)" question="\n$(tput setaf 2)<?>$(tput sgr0)" -cwd=$PWD +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"}" @@ -149,11 +149,11 @@ done ; unset dir_name spinner if [[ ! -s "$rvm_config_path/user" ]] ; then \mkdir -p "$rvm_config_path/" - echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user + echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_config_path/user" fi scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package") for script_name in "${scripts[@]}" ; do spinner @@ -168,30 +168,30 @@ spinner && sleep $sleep \rm -f "$rvm_bin_path/$file" \cp -f "$source_path/binscripts/$file" $rvm_bin_path/ done spinner -chmod +x $rvm_bin_path/* +chmod +x "$rvm_bin_path"/* # # RC Files # spinner if [[ -n "$rvm_auto_flag" ]] ; then printf "Checking rc files... ($rvm_rc_files)" if [[ "$rvm_loaded_flag" != "1" ]] ; then - for rcfile in $(echo $rvm_rc_files) ; do + for rcfile in $(printf $rvm_rc_files) ; do if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi if [[ -s "$HOME/.profile" ]] ; then if ! \grep -q '.profile' "$rcfile" ; then echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile." - printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile + printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> "$rcfile" fi fi if ! \grep -q "scripts\/rvm" "$rcfile" ; then echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile." - printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile + printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> "$rcfile" fi done fi fi @@ -252,48 +252,47 @@ # Migrate old gemset directories to new gemset pattern. # spinner printf "\r*" # Stop spinner. -for gemset in $rvm_path/gems/*\%* ; do +for gemset in "$rvm_path"/gems/*\%* ; do new_path=${gemset/\%/${rvm_gemset_separator}} if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then - printf "\n Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator." - mv $gemset $new_path + printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator." + mv "$gemset" "$new_path" fi done -for gemset in $rvm_path/gems/*\+* ; do +for gemset in "$rvm_path"/gems/*\+* ; do new_path=${gemset/\+/${rvm_gemset_separator}} if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then - printf "\n Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator." + printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator." mv $gemset $new_path fi done -for gemset in $rvm_path/gems/*\@ ; do + +for gemset in "$rvm_path"/gems/*\@ ; do new_path=$(echo $gemset | sed -e 's#\@$##') if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then - printf "\n Fixing: $(basename $gemset) to $(basename $new_path) for new gemset separator." - mv $gemset $new_path + printf "\n Fixing: $(basename "$gemset") to $(basename "$new_path") for new gemset separator." + mv "$gemset" "$new_path" fi done # Move from legacy defaults to the new, alias based system. if [[ -s "$rvm_config_path/default" ]]; then original_version="$(basename "$(\grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")" if [[ -n "$original_version" ]]; then - $rvm_scripts_path/alias create default "$original_version" &> /dev/null - fi - unset original_version + "$rvm_scripts_path/alias" create default "$original_version" &> /dev/null + fi ; unset original_version \rm -rf "$rvm_config_path/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" for file in rvm rvmsudo rvm-shell rvm-auto-ruby; do [[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file" done; unset file printf "\n Copying manpages into place." for man_file in $(\ls "$install_source_path/man"); do