2013-03-02 14:37:55 +08:00
|
|
|
rvm current 1>/dev/null 2>&1
|
|
|
|
|
2013-03-02 14:22:10 +08:00
|
|
|
function __check_rvm --on-variable PWD --description 'Setup rvm on directory change'
|
|
|
|
status --is-command-substitution; and return
|
|
|
|
|
|
|
|
if test "$rvm_project_rvmrc" != 0
|
|
|
|
set -l cwd $PWD
|
|
|
|
while true
|
|
|
|
if contains $cwd "" $HOME "/"
|
|
|
|
if test "$rvm_project_rvmrc_default" = 1
|
|
|
|
rvm default 1>/dev/null 2>&1
|
|
|
|
end
|
|
|
|
break
|
|
|
|
else
|
2013-05-22 01:59:56 +08:00
|
|
|
if begin ; test -s ".rvmrc" ; or test -s ".ruby-version" ; or test -s ".ruby-gemset" ; or test -s ".versions.conf" ; end
|
2015-02-05 23:25:23 +08:00
|
|
|
rvm reload 1> /dev/null 2>&1
|
|
|
|
rvm rvmrc load 1>/dev/null 2>&1
|
2013-03-02 14:22:10 +08:00
|
|
|
break
|
|
|
|
else
|
|
|
|
set cwd (dirname "$cwd")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
set -e cwd
|
|
|
|
end
|
|
|
|
end
|