scripts/set in rvm-0.1.27 vs scripts/set in rvm-0.1.29

- old
+ new

@@ -20,19 +20,17 @@ __rvm_select __rvm_use binary="$(echo $action | sed 's#do$##')" if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then - rm -f "$rvm_path/gems/cache" - ln -nfs "$HOME/.gem/cache" "$rvm_path/gems/cache" binary="$rvm_ruby_home/bin/$binary" elif [[ -x "$rvm_ruby_global_gems_path/bin/$binary" ]] ; then binary="$rvm_ruby_global_gems_path/bin/$binary" elif [[ -x "$rvm_ruby_gem_home/bin/$binary" ]] ; then binary="$rvm_ruby_gem_home/bin/$binary" - elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(which $binary)" ]] ; then - binary="$(basename $(which $binary 2>/dev/null) 2>/dev/null)" + elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(command -v $binary)" ]] ; then + binary="$(basename $(command -v $binary) 2>/dev/null)" else $rvm_scripts_path/log "warn" "'$binary not found for $rvm_ruby_string' either does not exist or is not executable? :(" __rvm_unset_ruby_variables return 1 fi @@ -40,11 +38,11 @@ if [[ ! -z "$rvm_ruby_mode" ]] ; then rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_mode}" rvm_ruby_mode="--$(echo $rvm_ruby_mode | sed 's/^m//')" fi - load_path="$(dirname $(which $binary 2>/dev/null) 2>/dev/null):$rvm_ruby_load_path" + load_path="$(dirname $(command -v $binary) 2>/dev/null):$rvm_ruby_load_path" # TODO: the else case below should be run if $args =~ /\.rb$/ if [[ "ruby" = "$(basename $binary)" ]] && [[ "$rvm_benchmark_flag" -ne 1 ]] ; then if $rvm_scripts_path/match "$args" "\.rb$" ; then if [[ -z "$prefix" ]] ; then prefix="-S" ; fi if ! $rvm_scripts_path/match "$args" "$prefix" ; then @@ -62,11 +60,13 @@ if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then mkdir -p ./log/$rvm_ruby_string/ touch ./log/$rvm_ruby_string/$action.log ./log/$rvm_ruby_string/$action.error.log eval "$rvm_command" >> ./log/$rvm_ruby_string/$action.log 2>> ./log/$rvm_ruby_string/$action.error.log else - $rvm_scripts_path/log "info" "$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v $rvm_ruby_mode | tr "\n" ' ')" + if [[ "$rvm_verbose_flag" != "0" ]] ; then + $rvm_scripts_path/log "info" "$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v $rvm_ruby_mode | tr "\n" ' ')" + fi eval "$rvm_command" fi result=$? string=$(basename $rvm_ruby_gem_home) @@ -144,11 +144,11 @@ return ${#errors[*]} } # Loop over a set or all rvm installed rubies to perform some action. # Record the results and report based on CLI selections. -#__rvm_do() { + rubies=() ; successes=() ; errors=() ; statuses=() # TODO: Extract the common functionality out of the if below if [[ ! -z "$rvm_ruby_string" ]] ; then unset rvm_ruby_interpreter rvm_ruby_version __rvm_ruby_do @@ -173,7 +173,5 @@ if [[ ! -z "$rvm_json_flag" ]] ; then __rvm_json ; fi $rvm_scripts_path/hook "after_do" exit ${#errors[*]} -#} -