diff --git a/scripts/cli b/scripts/cli index 423a867d4c..e5d69365a1 100755 --- a/scripts/cli +++ b/scripts/cli @@ -645,12 +645,18 @@ rvm() fi - # Check that this is the current version. + if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi + + __rvm_cleanse_variables + + __rvm_load_rvmrc + + __rvm_initialize + + # Check that this is the current version, after rvm_path has been determined. disk_version=$(cat "$rvm_path/VERSION") disk_version="${disk_version/%.}" - if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi - if [[ -n "${rvm_version:-""}" && "${rvm_version:-""}" != "${disk_version:-""}" \ && "reload" != "${next_token:-""}" ]] ; then @@ -660,12 +666,6 @@ rvm() fi - __rvm_cleanse_variables - - __rvm_load_rvmrc - - __rvm_initialize - __rvm_parse_args "$@" if [[ $? -gt 0 ]] ; then diff --git a/scripts/rvm b/scripts/rvm index b4bf17d68b..be7afffcae 100755 --- a/scripts/rvm +++ b/scripts/rvm @@ -1,8 +1,5 @@ #!/usr/bin/env bash -rvm_path= -rvm_prefix= - # rvm : Ruby enVironment Manager # http://rvm.beginrescueend.com # http://github.com/wayneeseguin/rvm @@ -50,7 +47,7 @@ if ! declare -f rvm > /dev/null || [[ ${rvm_reload_flag:-0} -eq 1 ]] ; then fi - if [[ -z "$rvm_prefix" ]] ; then + if [[ -z "${rvm_prefix:-""}" ]] ; then if [[ "${rvm_selfcontained:-0}" = "0" ]] ; then