Skip to content

Commit

Permalink
fix detecting installed rubies, fix #a82073e13555cb909720ec595afa2cab…
Browse files Browse the repository at this point in the history
…598d166f
  • Loading branch information
mpapis committed Jan 14, 2014
1 parent a82073e commit ed19062
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions scripts/functions/cli
Expand Up @@ -275,11 +275,12 @@ __rvm_cli_install_ruby()
if
[[ -n "$1" ]]
then
typeset __rubies __search __installed __missing
typeset __rubies __installed __missing __search_list
typeset -a __search
__rvm_custom_separated_array __search , "$1"
__rubies=""
__rvm_cli_rubies_select "$1" || return $?
__rubies="$1"
__search_list=""
__rvm_cli_rubies_select || return $?
if __rvm_cli_rubies_not_installed
then __rvm_run_wrapper manage install "${__rubies}" || return $?
fi
Expand All @@ -296,26 +297,22 @@ __rvm_cli_rubies_select()
do
rvm_ruby_string="${__ruby}"
__rvm_select &&
if
[[ -n "$rvm_ruby_string" ]]
then
__rubies+="$rvm_ruby_string,"
__search+="^$rvm_ruby_string\$|"
if [[ -n "$rvm_ruby_string" ]]
then __search_list+="^$rvm_ruby_string\$|"
else
rvm_error "Could not detect ruby version/name for installation '${__ruby}', please be more specific."
return 1
fi
done
__rubies="${__rubies%,}"
__search="${__search%|}"
__search_list="${__search_list%|}"
}

__rvm_cli_rubies_not_installed()
{
if
(( ${rvm_force_flag:-0} == 0 )) &&
__installed="$(
__rvm_list_strings | __rvm_grep -E "${__search}"
__rvm_list_strings | __rvm_grep -E "${__search_list}"
)" &&
[[ -n "${__installed}" ]]
then
Expand Down

0 comments on commit ed19062

Please sign in to comment.