scripts/cli in rvm-0.1.47 vs scripts/cli in rvm-1.0.0
- old
+ new
@@ -21,11 +21,11 @@
# TODO:
# Make this more robust '__rvm_history' so that it stores *unique* rvm commands.
# Otherwise this file gets big rather fast.
#echo "$@" >> $HOME/.rvm_history
- if echo "$@" | grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
+ if echo "$@" | \grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
while [[ $# -gt 0 ]] ; do
rvm_token="$1" ; shift
case "$rvm_token" in
fetch|version|srcdir|reset|debug|reload|update|monitor|notes|implode|seppuku|question|answer|env)
@@ -78,11 +78,11 @@
rvm_ruby_args="clear"
elif [[ "use" = "$1" ]] ; then
rvm_use_flag=1
rvm_ruby_args="$@" ; shift
rvm_gemset_name="$1" ; shift
- if [[ ! -z "$(echo $rvm_gemset_name | grep $rvm_gemset_separator)" ]] ; then
+ if [[ ! -z "$(echo $rvm_gemset_name | \grep $rvm_gemset_separator)" ]] ; then
rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)'${rvm_gemset_separator}'.*/\1/')
rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*'${rvm_gemset_separator}'\(.*\)/\1/')
if [[ "$rvm_ruby_string" != "$rvm_gemset_name" ]] ; then
rvm_ruby_string="$rvm_ruby_string${rvm_gemset_separator}$rvm_gemset_name"
fi
@@ -90,11 +90,11 @@
fi
elif [[ "delete" = "$1" ]] ; then
rvm_delete_flag=1
rvm_ruby_args="$@" ; shift
rvm_gemset_name="$1"; shift
- if [[ ! -z "$(echo $rvm_gemset_name | grep $rvm_gemset_separator)" ]] ; then
+ if [[ ! -z "$(echo $rvm_gemset_name | \grep $rvm_gemset_separator)" ]] ; then
rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)'${rvm_gemset_separator}'.*/\1/')
rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*'${rvm_gemset_separator}'\(.*\)/\1/')
if [[ "$rvm_ruby_string" != "$rvm_gemset_name" ]] ; then
rvm_ruby_string="$rvm_ruby_string${rvm_gemset_separator}$rvm_gemset_name"
fi
@@ -137,14 +137,20 @@
rvm_ruby_args="$(__rvm_quote_args "$@")"
rvm_parse_break=1
;;
load-rvmrc)
- rvm_action="$rvm_token"
- rvm_ruby_args="$1"
+ 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
+ ;;
do|ruby|rake|gem|rubydo|rakedo|gemdo)
if [[ "do" = "$rvm_action" ]] ; then rvm_action="ruby" ; fi
rvm_action=$(echo $rvm_token | sed 's#do##g')
if [[ "rake" = "$rvm_action" ]] || [[ "gem" = "$rvm_action" ]] || [[ "ruby" = "$rvm_action" ]] ; then
@@ -316,11 +322,11 @@
--disable-llvm|--disable-jit) rvm_llvm_flag=0 ;;
--enable-llvm|--enable-jit) rvm_llvm_flag=1 ;;
reboot|damnit|wtf|argh|BOOM|boom|wth) $rvm_action="reboot" ;;
- --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--sticky|--create|--rvmrc|--gems|--docs)
+ --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--sticky|--create|--gems|--docs)
export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
;;
--dump-environment)
export rvm_dump_environment_flag="$1"; shift
@@ -543,14 +549,13 @@
cleanup|tools|snapshot|disk-usage|repair|alias|docs|rubygems|migrate|upgrade)
__rvm_run_script "$rvm_action"
result=$?
;;
-
-
- load-rvmrc)
- __rvm_project_rvmrc "$rvm_ruby_args"
- result=$?
+
+ rvmrc)
+ eval "__rvm_rvmrc_tools $rvm_ruby_args"
+ result="$?"
;;
gemset)
#if $rvm_scripts_path/match $rvm_ruby_args use ; then
if [[ "$rvm_use_flag" -eq 1 ]] ; then