scripts/cli in rvm-1.0.8 vs scripts/cli in rvm-1.0.9

- old
+ new

@@ -82,11 +82,11 @@ ;; gemset) rvm_action=$rvm_token - rvm_ruby_gem_home="$GEM_HOME" + rvm_ruby_gem_home="${GEM_HOME:-""}" if [[ -z "$next_token" ]] ; then rvm_ruby_args="help" elif [[ "clear" = "$next_token" ]] ; then @@ -395,37 +395,35 @@ rvm_archflags="$next_token" if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi ;; --trace|--debug) - local option="" + local option export rvm_debug_flag=1 - for option in verbose noclobber nounset ; do - set -o $option - done + set -o verbose + set -o noclobber + set -o nounset if [[ -z "${ZSH_VERSION:-""}" ]] ; then set -o errtrace fi # errexit pipefail - if [[ "$rvm_token" = "--trace" ]] ; then export rvm_trace_flag=1 - set -o xtrace + #set -o xtrace if [[ -z "${ZSH_VERSION:-""}" ]] ; then export PS4='-[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() > }' fi fi ;; - --proxy) rvm_proxy="$next_token" if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi ;; @@ -577,12 +575,10 @@ if [[ -z "${rvm_action:-""}" && -n "${rvm_ruby_string:-""}" ]] ; then rvm_action="use" ; fi if [[ ${rvm_parse_break:-0} -eq 1 || -n "${rvm_error_message:-""}" ]] ; then break ; fi done - export rvm_head_flag $(env | awk -F= -v ORS=' ' '/^rvm_/{print $1}') - # Empty args list. while [[ $# -gt 0 ]] ; do shift ; done if [[ -n "${rvm_error_message:-""}" ]] ; then "$rvm_path/scripts"/log "fail" "$rvm_error_message ( see: 'rvm usage' )" @@ -630,11 +626,11 @@ rvm_action="${rvm_action:-usage}" result=0 - export BUNDLE_PATH GEM_HOME GEM_PATH $(env | awk -F= -v ORS=' ' '/^rvm_/{print $1}') + export BUNDLE_PATH GEM_HOME GEM_PATH rvm_action rvm_archflags rvm_bin_flag rvm_bin_path rvm_clang_flag rvm_configure_flags rvm_debug_flag rvm_delete_flag rvm_docs_type rvm_dump_environment_flag rvm_error_message rvm_file_name rvm_gemdir_flag rvm_gemset_name rvm_head_flag rvm_install_arguments rvm_install_on_use_flag rvm_interactive_flag rvm_llvm_flag rvm_loaded_flag rvm_make_flags rvm_niceness rvm_only_path_flag rvm_parse_break rvm_patch_names rvm_patch_original_pwd rvm_pretty_print_flag rvm_prior_cc rvm_proxy rvm_quiet_flag rvm_ree_options rvm_reload_flag rvm_remove_flag rvm_ruby_alias rvm_ruby_aliases rvm_ruby_args rvm_ruby_file rvm_ruby_gem_home rvm_ruby_interpreter rvm_ruby_load_path rvm_ruby_make rvm_ruby_make_install rvm_ruby_patch_level rvm_ruby_repo_url rvm_ruby_require rvm_ruby_string rvm_ruby_strings rvm_ruby_version rvm_script_name rvm_sdk rvm_silent_flag rvm_system_flag rvm_token rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_wrapper_name case "$rvm_action" in use) __rvm_use ;; srcdir) __rvm_source_dir ;; strings) __rvm_strings ;; @@ -702,11 +698,11 @@ # Clear the gemset. if [[ ${rvm_delete_flag:-0} -eq 1 ]] ; then gem_prefix="$(echo "${GEM_HOME:-""}" | sed 's/'${rvm_gemset_separator:-"@"}'.*$//')" - if [[ -n "${GEM_HOME:-""}" && "$GEM_HOME" = "${gem_prefix}${rvm_gemset_separator:-"@"}${rvm_gemset_name}" ]] ; then + if [[ "${GEM_HOME:-""}" = "${gem_prefix}${rvm_gemset_separator:-"@"}${rvm_gemset_name}" ]] ; then rvm_ruby_gem_home="$gem_prefix" GEM_HOME="$rvm_ruby_gem_home" BUNDLE_PATH="$rvm_ruby_gem_home" GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}global/bin" export rvm_ruby_gem_home GEM_HOME BUNDLE_PATH GEM_PATH @@ -763,8 +759,8 @@ if [[ ${rvm_trace_flag:-0} -eq 1 ]] ; then set +x rvm_trace_flag=0 fi - return $result + return ${result:-0} }