scripts/upgrade in rvm-1.0.6 vs scripts/upgrade in rvm-1.0.7
- old
+ new
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
unset GREP_OPTIONS
-source "$rvm_scripts_path/base"
+source "$rvm_path/scripts/base"
usage() {
echo "Usage: rvm upgrade prefix [specific version]" >&2
echo "Upgrades the latest installed ruby with a given prefix (e.g. ree) to a new version." >&2
exit 1
@@ -19,16 +19,16 @@
[[ -z "$confirmation_response" ]] || echo $confirmation_response | \grep -qi '^y\|^Y'
}
die_with_error() {
- "$rvm_scripts_path/log" "fail" "$1"
+ "$rvm_path/scripts/log" "fail" "$1"
exit "${2:-1}"
}
expand_ruby_name() {
- "$rvm_scripts_path/tools" strings "$1" | awk -F"$rvm_gemset_separator" '{print $1}'
+ "$rvm_path/scripts/tools" strings "$1" | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}'
}
expand_existing_ruby() {
local prefix ruby_name
@@ -38,11 +38,11 @@
if [[ "$ruby_name" != "$expanded_destination"* ]]; then
echo "$ruby_name" ; return 0
fi
- done < <("$rvm_scripts_path/list" strings | tr ' ' '\n' | sort -ur | \grep "^$prefix" | \grep -v '-head$' | head -n1)
+ done < <("$rvm_path/scripts/list" strings | tr ' ' '\n' | sort -ur | \grep "^$prefix" | \grep -v '-head$' | head -n1)
return 1
}
upgrade_ruby() {
@@ -55,27 +55,27 @@
confirm "Are you sure you wish to upgrade from $expanded_source to $expanded_destination?" || die_with_error "Cancelling upgrade."
if [[ ! -d "$rvm_rubies_path/$expanded_destination" ]]; then
- "$rvm_scripts_path/log" "info" \
+ "$rvm_path/scripts/log" "info" \
"Installing new ruby $expanded_destination"
$rvm_bin_path/rvm install "$expanded_destination"
result="$?" ; [[ "$result" -gt 0 ]] && die_with_error "Unable to install ruby $expanded_destination. Please install it manually to continue." "$result"
fi
- "$rvm_scripts_path/log" "info" \
+ "$rvm_path/scripts/log" "info" \
"Migrating gems from $expanded_source to $expanded_destination"
- "$rvm_scripts_path/migrate" "$expanded_source" "$expanded_destination"
+ "$rvm_path/scripts/migrate" "$expanded_source" "$expanded_destination"
result="$?"
[[ "$result" -gt 0 ]] && die_with_error "Error migrating gems." "$result"
- "$rvm_scripts_path/log" "info" "Upgrade complete!"
+ "$rvm_path/scripts/log" "info" "Upgrade complete!"
}
args=($*)
destination_ruby="${args[0]}"
source_ruby="${args[1]:-"$(expand_existing_ruby "$destination_ruby")"}"