Permalink
Browse files

fix detecting source ruby version for upgrade, fix #1424

  • Loading branch information...
1 parent c93226b commit 1999359ca67ef8dd254c73b47016e61a08608c3a @mpapis mpapis committed Jan 6, 2013
Showing with 5 additions and 8 deletions.
  1. +5 −8 scripts/upgrade
View
@@ -57,22 +57,19 @@ expand_ruby_name()
existing_ruby_patch()
{
- if
- "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep -E "^ruby-$1|^$1$" >/dev/null
- then
- echo "$1"
- else
+ {
+ "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep -E "^ruby-$1|^$1$" ||
(
rvm_ruby_string="$1"
__rvm_ruby_string
if "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-" >/dev/null
then
- "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-" | sort | tail -n 1
+ "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-"
else
- "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-" | sort | tail -n 1
+ "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-"
fi
)
- fi
+ } | sort | tail -n 1
}
highest_ruby_patch()

0 comments on commit 1999359

Please sign in to comment.