scripts/cli in rvm-1.0.0 vs scripts/cli in rvm-1.0.1

- old
+ new

@@ -1,16 +1,8 @@ #!/usr/bin/env bash -__rvm_usage() { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; } -# alternate usage impl: uses man page -#__rvm_usage() { - #if [[ `which man` ]]; then - #man 1 rvm ; } - #else - #cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} - #fi -#} +__rvm_usage() { ${PAGER:-less} "${rvm_path:-$HOME/.rvm}/README" ; } __rvm_run_script() { local rvm_script_name="${1:-"$rvm_action"}" eval "$rvm_scripts_path/$rvm_script_name $rvm_ruby_args" return $? @@ -141,11 +133,11 @@ load-rvmrc) rvm_action="rvmrc" rvm_ruby_args="'load' $(__rvm_quote_args "$@")" rvm_parse_break=1 ;; - + rvmrc) rvm_action="rvmrc" rvm_ruby_args="$(__rvm_quote_args "$@")" rvm_parse_break=1 ;; @@ -466,18 +458,20 @@ } rvm() { __rvm_setup - if [[ -n "$PS1" ]] ; then export rvm_interactive=1 ; else unset rvm_interactive ; fi + case $- in *i*) rvm_interactive=1 ;; + *) unset rvm_interactive ;; + esac ; export rvm_interactive if [[ -z "$ZSH_VERSION" ]] ; then trap '\rm -rf "$rvm_tmp_path/$$" >/dev/null 2>&1' 0 1 2 3 15 fi # Check that this is the current version. - disk_version=$(cat "${rvm_path:-$HOME/.rvm}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | \tr "\n" '.' | sed 's/\.$//') + disk_version=$(tail -n 3 < "${rvm_path:-$HOME/.rvm}/lib/VERSION.yml" | sed -e 's/^.*: //g' | \tr "\n" '.' | sed -e 's/\.$//') if [[ "${rvm_version}" != "${disk_version}" ]] && [[ "reload" != "$1" ]]; then printf "\nA RVM version ${disk_version} is installed yet ${rvm_version} is loaded.\n Please do one of the following:\n * 'rvm reload'\n * open a new shell\n * source your shell init scripts" return 1 fi @@ -549,10 +543,10 @@ cleanup|tools|snapshot|disk-usage|repair|alias|docs|rubygems|migrate|upgrade) __rvm_run_script "$rvm_action" result=$? ;; - + rvmrc) eval "__rvm_rvmrc_tools $rvm_ruby_args" result="$?" ;;