rvm 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,3 +3,4 @@
3
3
  if [[ -z "$1" ]] || [[ -z "$2" ]] ; then exit 1 ; fi
4
4
 
5
5
  if [[ -n "$(echo "$1" | awk "/${2}/")" ]] ; then exit 0 ; else exit 1 ; fi
6
+
@@ -14,16 +14,16 @@ confirm() {
14
14
  printf "$1 (Y/n): "
15
15
  local confirmation_response
16
16
  read -r confirmation_response
17
- [[ -z "$confirmation_response" ]] || echo "$confirmation_response" | grep -qi '^y'
17
+ [[ -z "$confirmation_response" ]] || echo "$confirmation_response" | \grep -qi '^y'
18
18
  }
19
19
 
20
20
  die_with_error() {
21
- $rvm_scripts_path/log "fail" "$1"
21
+ "$rvm_scripts_path/log" "fail" "$1"
22
22
  exit "${2:-1}"
23
23
  }
24
24
 
25
25
  expand_ruby_name() {
26
- $rvm_scripts_path/tools strings "$1" | awk -F"$rvm_gemset_separator" '{print $1}'
26
+ "$rvm_scripts_path/tools" strings "$1" | awk -F"$rvm_gemset_separator" '{print $1}'
27
27
  }
28
28
 
29
29
  migrate_rubies() {
@@ -49,7 +49,7 @@ migrate_rubies() {
49
49
 
50
50
  while read -r origin_gemset; do
51
51
  [[ "$origin_gemset" = "$expanded_source" || "$origin_gemset" = "$expanded_source$rvm_gemset_separator"* ]] || continue
52
- gemset_name="$(echo "$origin_gemset" | awk -F"$rvm_gemset_separator" '{print $2}')"
52
+ gemset_name="${origin_gemset/*${rvm_gemset_separator}/}"
53
53
  destination_gemset="$expanded_destination"
54
54
  if [[ -n "$gemset_name" ]]; then
55
55
  destination_gemset="$destination_gemset$rvm_gemset_separator$gemset_name"
@@ -64,21 +64,20 @@ migrate_rubies() {
64
64
  result="$?"
65
65
  [[ "$result" -gt "0" ]] && die_with_error "Unable to move '$rvm_gems_path/$origin_gemset' to '$rvm_gems_path/$destination_gemset'" "$result"
66
66
 
67
-
68
67
  echo "Making gemset $destination_gemset pristine."
69
68
  __rvm_run_with_env "gemset.pristine" "$destination_gemset" "rvm gemset pristine"
70
- done < <($rvm_scripts_path/list gemsets strings | grep "^$expanded_source")
69
+ done < <("$rvm_scripts_path/list" gemsets strings | \grep "^$expanded_source")
71
70
  unset origin_gemset destination_gemset gemset_name
72
71
 
73
72
  if confirm 'Do you wish to move over aliases?' ; then
74
73
  while read -r alias_pair; do
75
- migrate_ruby_name="$(echo "$alias_pair" | awk -F= '{print $2}')"
76
- migrate_alias_name="$(echo "$alias_pair" | awk -F= '{print $1}')"
74
+ migrate_ruby_name="${alias_pair/*=/}"
75
+ migrate_alias_name="${alias_pair/=*/}"
77
76
  if [[ "$migrate_ruby_name" = "$expanded_source" || "$migrate_ruby_name" = "$expanded_source$rvm_gemset_separator"* ]]; then
78
77
  migrate_new_alias_name="${migrate_ruby_name/$expanded_source/$expanded_destination}"
79
78
  echo "Updating alias $migrate_alias_name to point to $migrate_new_alias_name"
80
- $rvm_scripts_path/alias delete "$migrate_alias_name" >/dev/null 2>&1
81
- $rvm_scripts_path/alias create "$migrate_alias_name" "$migrate_new_alias_name" >/dev/null 2>&1
79
+ "$rvm_scripts_path/alias" delete "$migrate_alias_name" >/dev/null 2>&1
80
+ "$rvm_scripts_path/alias" create "$migrate_alias_name" "$migrate_new_alias_name" >/dev/null 2>&1
82
81
  fi
83
82
  done < "$rvm_config_path/alias"
84
83
  unset migrate_ruby_name migrate_alias_name migrate_new_alias_name
@@ -86,7 +85,7 @@ migrate_rubies() {
86
85
 
87
86
  if confirm "Do you wish to move over wrappers?" ; then
88
87
  origin_wrappers_path="$rvm_wrappers_path/$expanded_source"
89
- for binary_name in $(\ls $rvm_bin_path) ; do
88
+ for binary_name in $(\ls "$rvm_bin_path") ; do
90
89
  full_bin_path="$rvm_bin_path/$binary_name"
91
90
  [[ ! -L "$full_bin_path" ]] && continue
92
91
  expanded_symlink="$(readlink "$full_bin_path")"
@@ -58,11 +58,11 @@ while : ; do
58
58
  if [[ "spec" = "$framework" ]] ; then
59
59
  rvm_action="spec"
60
60
  rvm_ruby_args="spec/spec_helper.rb ${changed_spec_files[*]}"
61
- $rvm_scripts_path/set $rvm_action $rvm_ruby_args
61
+ "$rvm_scripts_path/set" $rvm_action $rvm_ruby_args
62
62
  elif [[ "test" = "$framework" ]] ; then
63
63
  rvm_action="ruby"
64
64
  rvm_ruby_args=" -r$(echo "${changed_test_files[*]}" | sed 's/ / -r/g') test/test_helper.rb"
65
- $rvm_scripts_path/set $rvm_action $rvm_ruby_args
65
+ "$rvm_scripts_path/set" $rvm_action $rvm_ruby_args
66
66
  fi
67
67
  update=1
68
68
  fi
@@ -73,11 +73,11 @@ while : ; do
73
73
  if [[ "spec" = "$framework" ]] ; then
74
74
  rvm_action="spec"
75
75
  rvm_ruby_args="spec/"
76
- $rvm_scripts_path/set $rvm_action $rvm_ruby_args
76
+ "$rvm_scripts_path/set" $rvm_action $rvm_ruby_args
77
77
  elif [[ "test" = "$framework" ]] ; then
78
78
  rvm_action="rake"
79
79
  rvm_ruby_args="test"
80
- $rvm_scripts_path/set $rvm_action $rvm_ruby_args
80
+ "$rvm_scripts_path/set" "$rvm_action" $rvm_ruby_args
81
81
  fi
82
82
  update=1
83
83
  fi
@@ -4,9 +4,9 @@ source "$rvm_scripts_path/base"
4
4
 
5
5
  # Tools to make managing ruby dependencies inside of rvm easier.
6
6
 
7
- action="$(echo "$*" | awk '{print $1}')"
8
- library="$(echo "$*" | awk '{print $2}')"
9
- args=$(echo "$*" | awk '{$1="" ; $2="" ; print}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
7
+ action="$1" ; shift
8
+ library="$1" ; shift
9
+ args="$(echo $*) " # Strip trailing / leading / extra spacing.
10
10
 
11
11
  install_package() {
12
12
 
@@ -14,18 +14,18 @@ install_package() {
14
14
 
15
15
  if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
16
16
 
17
- __rvm_pushpop $rvm_src_path
17
+ __rvm_pushpop "$rvm_src_path"
18
18
 
19
- $rvm_scripts_path/log "info" "Fetching $package-$version.$archive_format to $rvm_archives_path"
19
+ "$rvm_scripts_path/log" "info" "Fetching $package-$version.$archive_format to $rvm_archives_path"
20
20
 
21
21
  if [[ "$archive_format" = "tar.gz" ]] || [[ "$archive_format" = "tgz" ]] ; then
22
- $rvm_scripts_path/fetch "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
22
+ "$rvm_scripts_path/fetch" "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
23
23
  __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format to $rvm_src_path"
24
24
  elif [[ "$archive_format" = "tar.bz2" ]] ; then
25
- $rvm_scripts_path/fetch "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
25
+ "$rvm_scripts_path/fetch" "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
26
26
  __rvm_run "$package/extract" "tar jxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format to $rvm_src_path"
27
27
  elif [[ "$archive_format" = "zip" ]] ; then
28
- $rvm_scripts_path/fetch "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
28
+ "$rvm_scripts_path/fetch" "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
29
29
  __rvm_run "$package/extract" "unzip -q -o $rvm_archives_path/$package-$version.$archive_format -d $rvm_src_path/$package-$version" "Extracting $package-$version.$archive_format to $rvm_src_path"
30
30
  else
31
31
  printf "\nUnrecognized archive format '$archive_format'" ; return 1
@@ -45,7 +45,7 @@ install_package() {
45
45
  fi
46
46
 
47
47
  \touch "$rvm_config_path/packages"
48
- $rvm_scripts_path/db "$rvm_config_path/packages" "${package}" "${version}"
48
+ "$rvm_scripts_path/db" "$rvm_config_path/packages" "${package}" "${version}"
49
49
 
50
50
  __rvm_pushpop
51
51
  }
@@ -72,10 +72,10 @@ openssl() {
72
72
  package="openssl" ; version="0.9.8n" ; archive_format="tar.gz"
73
73
  if [[ "Darwin" = "$(uname)" ]] ; then
74
74
  if [[ ! -z "$rvm_archflags" ]]; then
75
- if $rvm_scripts_path/match "$rvm_archflags" "64"; then
75
+ if "$rvm_scripts_path/match" "$rvm_archflags" "64"; then
76
76
  hw_cpu64bit=1
77
77
  fi
78
- if $rvm_scripts_path/match "$rvm_archflags" "ppc"; then
78
+ if "$rvm_scripts_path/match" "$rvm_archflags" "ppc"; then
79
79
  hw_machine="Power Macintosh"
80
80
  fi
81
81
  else
@@ -99,7 +99,7 @@ openssl() {
99
99
  patches="$rvm_patches_path/$package/Makefile.org.patch,$rvm_patches_path/$package/crypto-Makefile.patch"
100
100
  # Don't use -j option for make OpenSSL
101
101
  if [[ ! -z "$rvm_make_flags" ]] ; then
102
- rvm_make_flags=$(echo $rvm_make_flags | sed -e "s/-j[[:space:]]*[[0-9]]*//")
102
+ rvm_make_flags=$(echo "$rvm_make_flags" | sed -e "s/-j[[:space:]]*[[0-9]]*//")
103
103
  fi
104
104
  else
105
105
  configure_command="./config"
@@ -181,10 +181,10 @@ if [[ ! -z "$library" ]] ; then
181
181
  if [[ " readline iconv curl openssl zlib autoconf ncurses pkgconfig gettext glib mono llvm libxml2 " =~ "$library" ]] ; then
182
182
  ${library}
183
183
  else
184
- $rvm_scripts_path/log "error" "Package '${library}' is unknown."
184
+ "$rvm_scripts_path/log" "error" "Package '${library}' is unknown."
185
185
  fi
186
186
  else
187
- $rvm_scripts_path/log "info" "Usage: 'rvm package {install,uninstall} {readline,iconv,curl,openssl,zlib,autoconf,ncurses,pkgconfig,gettext,glib,mono,llvm,libxml2}'"
187
+ "$rvm_scripts_path/log" "info" "Usage: 'rvm package {install,uninstall} {readline,iconv,curl,openssl,zlib,autoconf,ncurses,pkgconfig,gettext,glib,mono,llvm,libxml2}'"
188
188
  exit 1
189
189
  fi
190
190
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  # Returns the path used to look for a patch given a specific name.
7
7
  __rvm_patch_lookup_path() {
8
- echo "/"
8
+ echo "/"
9
9
  [[ -n "$rvm_patch_original_pwd" ]] && echo "$rvm_patch_original_pwd/"
10
10
  echo "$PWD/"
11
11
  __rvm_ruby_string_paths_under "$rvm_patches_path" | sed 's/$/\//'
@@ -13,13 +13,12 @@ __rvm_patch_lookup_path() {
13
13
 
14
14
  __rvm_expand_patch_name() {
15
15
  [[ -z "$1" ]] && return
16
- expanded_patch_name="$($rvm_scripts_path/patchsets show "$1")"
16
+ expanded_patch_name="$("$rvm_scripts_path/patchsets" show "$1")"
17
17
  if [[ "$?" == "0" ]]; then
18
18
  echo "$expanded_patch_name"
19
19
  elif [[ "$1" != "default" ]]; then
20
20
  echo "$1"
21
- fi
22
- unset expanded_patch_name
21
+ fi ; unset expanded_patch_name
23
22
  }
24
23
 
25
24
  # Return the full patch for a given patch.
@@ -14,7 +14,7 @@ repair_symlinks() {
14
14
  for executable_name in $(\find \. -type l); do
15
15
  [[ -e "$executable_name" || "$(readlink "$executable_name")" != "$rvm_wrappers_path/"* ]] && continue
16
16
  if [[ -f "$executable_name" ]] ; then
17
- $rvm_scripts_path/log "info" "Removing stale symlink from $(basename "$executable_name")"
17
+ "$rvm_scripts_path/log" "info" "Removing stale symlink from $(basename "$executable_name")"
18
18
  \rm -f "$executable_name"
19
19
  fi
20
20
  done; unset executable_name
@@ -25,7 +25,7 @@ repair_symlinks() {
25
25
  repair_environments() {
26
26
  for environment_name in $(\ls "$rvm_environments_path"); do
27
27
  [[ -L "$rvm_environments_path/$environment_name" ]] && continue
28
- $rvm_scripts_path/log "info" "Regenerating environment file for '$environment_name'"
28
+ "$rvm_scripts_path/log" "info" "Regenerating environment file for '$environment_name'"
29
29
  [[ -f "$rvm_environments_path/$environment_name" ]] && \rm -f "$rvm_environments_path/$environment_name"
30
30
  (source "$rvm_scripts_path/base"; __rvm_become "$environment_name"; __rvm_ensure_has_environment_files)
31
31
  done; unset environment_name
@@ -36,8 +36,8 @@ repair_archives() {
36
36
  for archive_file in $(\ls "$rvm_archives_path"); do
37
37
  [[ -f "$rvm_archives_path/$archive_file" ]] || continue
38
38
  local stored_md5sum="$($rvm_scripts_path/db "$rvm_config_path/md5" "$archive_file" | head -n1)"
39
- if [[ -n "$stored_md5sum" ]] && ! $rvm_scripts_path/md5 "$rvm_archives_path/$archive_file" "$stored_md5sum" ; then
40
- $rvm_scripts_path/log "info" "Removing archive for '$archive_file' - Incorrect md5 checksum."
39
+ if [[ -n "$stored_md5sum" ]] && ! "$rvm_scripts_path/md5" "$rvm_archives_path/$archive_file" "$stored_md5sum" ; then
40
+ "$rvm_scripts_path/log" "info" "Removing archive for '$archive_file' - Incorrect md5 checksum."
41
41
  \rm -rf "$rvm_archives_path/$archive_file"
42
42
  fi
43
43
  done; unset archive_file
@@ -47,7 +47,7 @@ repair_all() {
47
47
  repair_symlinks
48
48
  repair_archives
49
49
  repair_environments
50
- $rvm_scripts_path/log "info" "All items repaired."
50
+ "$rvm_scripts_path/log" "info" "All items repaired."
51
51
  }
52
52
 
53
53
  if [[ -z "$1" ]]; then
@@ -9,7 +9,7 @@ __rvm_become
9
9
  rubygems_setup() {
10
10
  __rvm_warn_on_rubyopt
11
11
  unset RUBYOPT
12
- if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.9/')" ]] || [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^mput/')" ]] ; then
12
+ if [[ ! -z "$(echo "$rvm_ruby_version" | awk '/^1\.9/')" ]] || [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^mput/')" ]] ; then
13
13
  install=0
14
14
  elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then
15
15
  install=0
@@ -20,17 +20,17 @@ rubygems_setup() {
20
20
  fi
21
21
 
22
22
  if [[ "$install" -eq 0 ]] ; then
23
- $rvm_scripts_path/log "error" "Cannot switch to ${version} for this interpreter."
23
+ "$rvm_scripts_path/log" "error" "Cannot switch to ${version} for this interpreter."
24
24
  exit 1
25
25
  else
26
- $rvm_scripts_path/log "info" "Removing old Rubygems files..."
26
+ "$rvm_scripts_path/log" "info" "Removing old Rubygems files..."
27
27
  rubygems_dir="$(ruby -rrbconfig -e "puts Config::CONFIG.values_at('sitelibdir','vendorlibdir').detect {|path| File.directory?(File.join(path, 'rubygems')) }.to_s")"
28
28
  if [[ -n "$rubygems_dir" && -d "$rubygems_dir" ]]; then
29
29
  # Remove common files installed by ruby gems.
30
30
  \rm -rf "${rubygems_dir}/ubygems.rb" "${rubygems_dir}/rubygems.rb" "${rubygems_dir}/rubygems" "${rubygems_dir}/gauntlet_rubygems.rb"
31
31
  fi
32
32
 
33
- $rvm_scripts_path/log "info" "Installing rubygems dedicated to $rvm_ruby_string..."
33
+ "$rvm_scripts_path/log" "info" "Installing rubygems dedicated to $rvm_ruby_string..."
34
34
  rvm_rubygems_version="$version"
35
35
  rvm_gem_package_name="rubygems-$rvm_rubygems_version"
36
36
  rvm_rubygems_url=$(__rvm_db "rubygems_${rvm_rubygems_version}_url")
@@ -43,10 +43,10 @@ rubygems_setup() {
43
43
  fi
44
44
 
45
45
  if [[ ! -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
46
- $rvm_scripts_path/log "info" "Retrieving $rvm_gem_package_name"
47
- $rvm_scripts_path/fetch "$rvm_gem_url"
46
+ "$rvm_scripts_path/log" "info" "Retrieving $rvm_gem_package_name"
47
+ "$rvm_scripts_path/fetch" "$rvm_gem_url"
48
48
  result=$? ; if [[ "$result" -gt 0 ]] ; then
49
- $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
49
+ "$rvm_scripts_path/log" "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
50
50
  fi
51
51
  \mkdir -p "$rvm_src_path/$rvm_gem_package_name"
52
52
  __rvm_run "rubygems.extract" "gunzip < $rvm_archives_path/$rvm_gem_package_name.tgz | tar xf - -C $rvm_src_path" "Extracting $rvm_gem_package_name ..."
@@ -57,9 +57,9 @@ rubygems_setup() {
57
57
  __rvm_run "rubygems.install" "GEM_PATH=$rvm_ruby_gem_path GEM_HOME=$rvm_ruby_gem_home BUNDLE_PATH=$rvm_ruby_gem_home $rvm_ruby_home/bin/ruby $rvm_src_path/$rvm_gem_package_name/setup.rb" "Installing rubygems for $rvm_ruby_home/bin/ruby"
58
58
  result=$?
59
59
  if [[ "$result" == 0 ]] ; then
60
- $rvm_scripts_path/log "info" "Installation of rubygems completed successfully."
60
+ "$rvm_scripts_path/log" "info" "Installation of rubygems completed successfully."
61
61
  else
62
- $rvm_scripts_path/log "warning" "Installation of rubygems did not complete successfully."
62
+ "$rvm_scripts_path/log" "warning" "Installation of rubygems did not complete successfully."
63
63
  fi
64
64
 
65
65
  if [[ ! -z "$rvm_major_version" ]] ; then
@@ -80,7 +80,7 @@ rubygems_setup() {
80
80
  }
81
81
 
82
82
  if ! command -v ruby > /dev/null ; then
83
- $rvm_scripts_path/log "error" "'ruby' was not found, cannot install rubygems unless ruby is present (Do you have an RVM ruby installed & selected?)"
83
+ "$rvm_scripts_path/log" "error" "'ruby' was not found, cannot install rubygems unless ruby is present (Do you have an RVM ruby installed & selected?)"
84
84
  exit 1
85
85
  fi
86
86
 
@@ -91,7 +91,7 @@ if [[ $# -gt 0 ]] ; then
91
91
  version="$1" ; shift
92
92
  args="$(echo "$@" | __rvm_strip)"
93
93
  else
94
- $rvm_scripts_path/log "error" "A version must be specified, for example 'rvm rubygems 1.3.7'"
94
+ "$rvm_scripts_path/log" "error" "A version must be specified, for example 'rvm rubygems 1.3.7'"
95
95
  exit 1
96
96
  fi
97
97
 
@@ -6,6 +6,7 @@
6
6
 
7
7
  rvm_reload_flag="${rvm_reload_flag:-0}"
8
8
  rvm_loaded_flag="${rvm_loaded_flag:-0}"
9
+
9
10
  if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
10
11
  unset rvm_reload_flag
11
12
 
@@ -59,7 +60,6 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
59
60
  source "$rvm_scripts_path/version"
60
61
  source "$rvm_scripts_path/selector"
61
62
  source "$rvm_scripts_path/cli"
62
- source "$rvm_scripts_path/manpages"
63
63
  source "$rvm_scripts_path/cd"
64
64
  source "$rvm_scripts_path/override_gem"
65
65
 
@@ -74,10 +74,10 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
74
74
  source "$rvm_environments_path/default"
75
75
  fi
76
76
  fi
77
-
77
+
78
78
  # Makes sure rvm_bin_path is in PATH atleast once.
79
79
  __rvm_conditionally_add_bin_path
80
-
80
+
81
81
  else
82
82
  printf "\n\$rvm_path is not set. rvm cannot load."
83
83
  fi
@@ -76,7 +76,7 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
76
76
 
77
77
  source scripts/initialize
78
78
 
79
- if \grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || \grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
79
+ if \grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null || \grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null; then
80
80
  if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
81
81
  export upgrade_flag=1
82
82
  else
@@ -93,7 +93,7 @@ __rvm_initialize
93
93
  #
94
94
  item="$(tput setaf 2)* $(tput sgr0)"
95
95
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
96
- cwd=$PWD
96
+ cwd="$PWD"
97
97
  source_path="${source_path:-$cwd}"
98
98
  rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
99
99
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
@@ -151,7 +151,7 @@ done ; unset dir_name
151
151
  spinner
152
152
  if [[ ! -s "$rvm_config_path/user" ]] ; then
153
153
  \mkdir -p "$rvm_config_path/"
154
- echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user
154
+ echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_config_path/user"
155
155
  fi
156
156
 
157
157
  scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package")
@@ -170,7 +170,7 @@ for file in rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby ; do
170
170
  \cp -f "$source_path/binscripts/$file" $rvm_bin_path/
171
171
  done
172
172
  spinner
173
- chmod +x $rvm_bin_path/*
173
+ chmod +x "$rvm_bin_path"/*
174
174
 
175
175
  #
176
176
  # RC Files
@@ -179,17 +179,17 @@ spinner
179
179
  if [[ -n "$rvm_auto_flag" ]] ; then
180
180
  printf "Checking rc files... ($rvm_rc_files)"
181
181
  if [[ "$rvm_loaded_flag" != "1" ]] ; then
182
- for rcfile in $(echo $rvm_rc_files) ; do
182
+ for rcfile in $(printf $rvm_rc_files) ; do
183
183
  if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi
184
184
  if [[ -s "$HOME/.profile" ]] ; then
185
185
  if ! \grep -q '.profile' "$rcfile" ; then
186
186
  echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
187
- printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
187
+ printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> "$rcfile"
188
188
  fi
189
189
  fi
190
190
  if ! \grep -q "scripts\/rvm" "$rcfile" ; then
191
191
  echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
192
- printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile
192
+ printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> "$rcfile"
193
193
  fi
194
194
  done
195
195
  fi
@@ -254,26 +254,27 @@ done
254
254
  spinner
255
255
  printf "\r*" # Stop spinner.
256
256
 
257
- for gemset in $rvm_path/gems/*\%* ; do
257
+ for gemset in "$rvm_path"/gems/*\%* ; do
258
258
  new_path=${gemset/\%/${rvm_gemset_separator}}
259
259
  if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
260
- printf "\n Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
261
- mv $gemset $new_path
260
+ printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
261
+ mv "$gemset" "$new_path"
262
262
  fi
263
263
  done
264
264
 
265
- for gemset in $rvm_path/gems/*\+* ; do
265
+ for gemset in "$rvm_path"/gems/*\+* ; do
266
266
  new_path=${gemset/\+/${rvm_gemset_separator}}
267
267
  if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
268
- printf "\n Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
268
+ printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
269
269
  mv $gemset $new_path
270
270
  fi
271
271
  done
272
- for gemset in $rvm_path/gems/*\@ ; do
272
+
273
+ for gemset in "$rvm_path"/gems/*\@ ; do
273
274
  new_path=$(echo $gemset | sed -e 's#\@$##')
274
275
  if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
275
- printf "\n Fixing: $(basename $gemset) to $(basename $new_path) for new gemset separator."
276
- mv $gemset $new_path
276
+ printf "\n Fixing: $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
277
+ mv "$gemset" "$new_path"
277
278
  fi
278
279
  done
279
280
 
@@ -281,18 +282,16 @@ done
281
282
  if [[ -s "$rvm_config_path/default" ]]; then
282
283
  original_version="$(basename "$(\grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
283
284
  if [[ -n "$original_version" ]]; then
284
- $rvm_scripts_path/alias create default "$original_version" &> /dev/null
285
- fi
286
- unset original_version
285
+ "$rvm_scripts_path/alias" create default "$original_version" &> /dev/null
286
+ fi ; unset original_version
287
287
  \rm -rf "$rvm_config_path/default"
288
288
  fi
289
289
 
290
290
  #
291
291
  # End of gemset migration.
292
292
  #
293
-
294
293
  printf "\n Correct permissions for base binaries in $rvm_bin_path..."
295
- \mkdir -p $rvm_bin_path
294
+ \mkdir -p "$rvm_bin_path"
296
295
  for file in rvm rvmsudo rvm-shell rvm-auto-ruby; do
297
296
  [[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file"
298
297
  done; unset file