diff --git a/scripts/cli b/scripts/cli index a9c057dce9..cbb5297938 100644 --- a/scripts/cli +++ b/scripts/cli @@ -243,22 +243,22 @@ __rvm_parse_args() { rvm_ruby_string="$rvm_token" ;; - --install) rvm_install_on_use_flag=1 ;; - -h|--help|usage|help) rvm_action=help ;; - -G|--gems) rvm_gem_path="$1" ; shift ;; - --source) rvm_src_path="$1" ; shift ;; - --archives) rvm_archives_path="$1" ; shift ;; - --make) rvm_ruby_make="$1" ; shift ;; - --make-install) rvm_ruby_make_install="$1" ; shift ;; - --nice) rvm_niceness="$1" ; shift ;; - -l|--level) rvm_ruby_patch_level="p$1" ; shift ;; + --install) rvm_install_on_use_flag=1 ;; + -h|--help|usage|help) rvm_action=help ;; + -G|--gems) rvm_gem_path="$1" ; shift ;; + --source) rvm_src_path="$1" ; shift ;; + --archives) rvm_archives_path="$1" ; shift ;; + --make) rvm_ruby_make="$1" ; shift ;; + --make-install) rvm_ruby_make_install="$1" ; shift ;; + --nice) rvm_niceness="$1" ; shift ;; + -l|--level) rvm_ruby_patch_level="p$1" ; shift ;; # TODO: handle this below better (if $1 is null) - -m|--gem-set) rvm_gem_set_name="$1" ; shift ;; - --sdk) rvm_sdk="$1" ; shift ;; - --archflags) rvm_archflags="$1" ; shift ;; + -m|--gem-set) rvm_gem_set_name="$1" ; shift ;; + --sdk) rvm_sdk="$1" ; shift ;; + --archflags) rvm_archflags="$1" ; shift ;; - tests|specs) rvm_action="tests" ;; - --trace) eval "rvm_$(echo $rvm_token | sed 's#-##g')_flag=1" ; set -x ;; + tests|specs) rvm_action="tests" ;; + --trace) export rvm_trace_flag=1 ; set -x ;; --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--jit|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose) eval "rvm_$(echo $rvm_token | sed 's#-##g')_flag=1" @@ -352,7 +352,6 @@ rvm() { __rvm_load_defaults __rvm_parse_args $@ - if [[ -z "$rvm_trace_flag" ]] ; then set +x ; else set -x ; fi result=0 case "$rvm_action" in use) __rvm_use ; result=$? ;; @@ -415,7 +414,7 @@ rvm() { if [[ "$rvm_reload_flag" -eq 1 ]] ; then source "$rvm_path/scripts/rvm" ; fi - if [[ "1" = "$rvm_trace_flag" ]] ; then set +x ; unset rvm_trace_flag ; fi + if [[ "$rvm_trace_flag" -eq 1 ]] ; then set +x ; unset rvm_trace_flag ; fi return $result } diff --git a/scripts/manage b/scripts/manage index bc7859a601..fcdd7f94a2 100755 --- a/scripts/manage +++ b/scripts/manage @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [[ -z "$rvm_trace_flag" ]] ; then set +x ; else set -x ; fi +if [[ "$rvm_trace_flag" -eq 1 ]] ; then set -x ; export rvm_trace_flag ; fi original_ruby_version=$rvm_ruby_version original_ruby_string=$rvm_ruby_string @@ -20,9 +20,6 @@ __rvm_install_source() { __rvm_fetch_ruby if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi - __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." - if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi - builtin cd $rvm_ruby_src_path if [[ $? -gt 0 ]] ; then result=$? ; $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; __rvm_pushpop ; return $result ; fi @@ -440,6 +437,8 @@ __rvm_fetch_ruby() { $rvm_scripts_path/log "info" "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..." $rvm_scripts_path/fetch "$rvm_url" result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi + __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." + if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi fi else if [[ ! -z "$(echo $rvm_url | awk '/^git/')" ]] ; then