AutoYADM commit: 2025-04-16 19:35:12

This commit is contained in:
Daniel Fichtinger 2025-04-16 19:35:12 -04:00
parent ba256e3495
commit 26a6eb47d5

View file

@ -1,11 +1,12 @@
# Defined via `source` # One-time setup, preserve original cd definition
if not functions -q __cd_orig
functions --copy cd __cd_orig
end
function cd --wraps=cd --description "Change directory. No args goes to git root or $HOME." function cd --wraps=cd --description "Change directory. No args goes to git root or $HOME."
set -l cdfunc /usr/share/fish/functions/cd.fish
if test (count $argv) -ne 0; or not git rev-parse --is-inside-work-tree &>/dev/null if test (count $argv) -ne 0; or not git rev-parse --is-inside-work-tree &>/dev/null
source $cdfunc __cd_orig $argv
cd $argv
else else
source $cdfunc __cd_orig (git rev-parse --show-toplevel)
cd (git rev-parse --show-toplevel)
end end
end end