1
0
Fork 0
vdotfiles/cli/.config/fish/functions/groot.fish

7 lines
240 B
Fish
Raw Normal View History

2023-02-05 22:13:01 +02:00
function groot
set -l is_git_worktree (command git rev-parse --is-inside-work-tree)
string match -qe 'true' "$is_git_worktree" || return
2023-02-05 22:13:01 +02:00
set -l root (command git rev-parse --show-toplevel)
test $status -eq 0 && cd $root
end