mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-22 14:42:20 +08:00
Fixing 'cd' function to use fish's 'cd' function and not the builtin command
This commit is contained in:
parent
e9962924c3
commit
9034c9de51
|
@ -1,26 +1,34 @@
|
|||
function cd --description "Change working directory"
|
||||
# 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
|
||||
#
|
||||
# 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
|
||||
#
|
||||
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
|
||||
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
|
||||
if test -s ".rvmrc"
|
||||
eval "rvm reload" > /dev/null
|
||||
break
|
||||
else
|
||||
set cwd (dirname "$cwd")
|
||||
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
|
||||
if test -s ".rvmrc"
|
||||
eval "rvm reload" > /dev/null
|
||||
break
|
||||
else
|
||||
set cwd (dirname "$cwd")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
set -e cwd
|
||||
end
|
||||
end
|
||||
'
|
||||
|
||||
set -e cwd
|
||||
end
|
||||
cd "$argv"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user