scripts/cd in rvm-0.0.999 vs scripts/cd in rvm-0.0.9999

- old
+ new

@@ -1,15 +1,16 @@ #!/usr/bin/env bash # Source a .rvmrc file in a directory after changing to it, if it exists. -cd() { - builtin cd "$@" - if [[ "$rvm_project_rvmrc" != 0 ]] ; then +# To disable this fature, set rvm_project_rvmrc=0 in $HOME/.rvmrc +if [[ "$rvm_project_rvmrc" != 0 ]] ; then + cd() { + builtin cd "$@" local cwd ; cwd=$(pwd) while : ; do if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then - if [[ "$rvm_project_rvmrc_default" != 0 ]] ; then + if [[ "$rvm_project_rvmrc_default" = 1 ]] ; then rvm default 1>/dev/null 2>&1 fi break else if [[ -f "$cwd/.rvmrc" ]] ; then @@ -18,8 +19,7 @@ else cwd=$(dirname "$cwd") fi fi done - fi -} - + } +fi