Skip to content
This repository
Browse code

make sure use is only used when rvm is a function for gemset subcomma…

…nds, fix #1412
  • Loading branch information...
commit 7349f075ab1c5b164f6f9de8a870eae6393b7ca9 1 parent 0a1ba86
Michal Papis mpapis authored

Showing 1 changed file with 24 additions and 18 deletions. Show diff stats Hide diff stats

  1. +24 18 scripts/cli
42 scripts/cli
@@ -984,34 +984,40 @@ Please do one of the following:
984 984 if
985 985 [[ ${rvm_use_flag:-0} -eq 1 ]]
986 986 then
987   - __rvm_gemset_use
  987 + if rvm_is_a_shell_function
  988 + then __rvm_gemset_use
  989 + fi
988 990 else
989 991 export rvm_ruby_strings
990 992 "$rvm_scripts_path/gemsets" "${rvm_ruby_args[@]}"
991 993 result=$?
992 994 rvm_ruby_strings=""
993   - # Clear the gemset.
994 995 if
995   - [[ ${rvm_delete_flag:-0} -eq 1 ]]
  996 + rvm_is_a_shell_function no_warning
996 997 then
  998 + # Clear the gemset.
997 999 if
998   - [[ "${GEM_HOME:-""}" == "${GEM_HOME%%${rvm_gemset_separator:-@}*}${rvm_gemset_separator:-@}${rvm_gemset_name}" ]]
  1000 + [[ ${rvm_delete_flag:-0} -eq 1 ]]
999 1001 then
1000   - rvm_delete_flag=0
1001   - rvm_ruby_string="@default"
1002   - __rvm_use
1003   - fi
1004   - unset gem_prefix
1005   - elif
1006   - [[ "${rvm_ruby_args[*]}" =~ ^rename ]]
1007   - then
1008   - typeset _command _from _to
1009   - read _command _from _to <<<"${rvm_ruby_args[*]}"
1010   - if
1011   - [[ "${GEM_HOME:-""}" == "${GEM_HOME%%${rvm_gemset_separator:-@}*}${rvm_gemset_separator:-@}${_from}" ]]
  1002 + if
  1003 + [[ "${GEM_HOME:-""}" == "${GEM_HOME%%${rvm_gemset_separator:-@}*}${rvm_gemset_separator:-@}${rvm_gemset_name}" ]]
  1004 + then
  1005 + rvm_delete_flag=0
  1006 + rvm_ruby_string="@default"
  1007 + __rvm_use
  1008 + fi
  1009 + unset gem_prefix
  1010 + elif
  1011 + [[ "${rvm_ruby_args[*]}" =~ ^rename ]]
1012 1012 then
1013   - rvm_ruby_string="@${_to}"
1014   - __rvm_use
  1013 + typeset _command _from _to
  1014 + read _command _from _to <<<"${rvm_ruby_args[*]}"
  1015 + if
  1016 + [[ "${GEM_HOME:-""}" == "${GEM_HOME%%${rvm_gemset_separator:-@}*}${rvm_gemset_separator:-@}${_from}" ]]
  1017 + then
  1018 + rvm_ruby_string="@${_to}"
  1019 + __rvm_use
  1020 + fi
1015 1021 fi
1016 1022 fi
1017 1023 fi

0 comments on commit 7349f07

Please sign in to comment.
Something went wrong with that request. Please try again.