Commit 9034c9de authored by Bruno Pinto's avatar Bruno Pinto

Fixing 'cd' function to use fish's 'cd' function and not the builtin command

parent e9962924
function cd --description "Change working directory" #
# Source a .rvmrc file in a directory after changing to it, if it exists. # Source a .rvmrc file in a directory after changing to it, if it exists.
# To disable this feature, set rvm_project_rvmrc=0 in $HOME/.rvmrc # To disable this feature, set rvm_project_rvmrc=0 in $HOME/.rvmrc
#
function cd --description "Change directory"
redefine_function 'cd' "$__fish_datadir/functions/cd.fish" '
function cd --description "Change working directory"
old_cd "$argv"
builtin cd "$argv" if test "$rvm_project_rvmrc" != 0
if test "$rvm_project_rvmrc" != 0 set -l cwd $PWD
set -l cwd $PWD while true
while true if contains $cwd "" $HOME "/"
if contains $cwd "" $HOME "/" if test "$rvm_project_rvmrc_default" = 1
if test "$rvm_project_rvmrc_default" = 1 rvm default 1>/dev/null 2>&1
rvm default 1>/dev/null 2>&1 end
end break
break else
else if test -s ".rvmrc"
if test -s ".rvmrc" eval "rvm reload" > /dev/null
eval "rvm reload" > /dev/null break
break else
else set cwd (dirname "$cwd")
set cwd (dirname "$cwd") end
end
end end
set -e cwd
end end
end end
'
set -e cwd cd "$argv"
end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment