AutoYADM commit: 2025-04-18 15:00:05
This commit is contained in:
parent
fdf077274a
commit
f2c722eeaa
1 changed files with 8 additions and 2 deletions
|
@ -24,11 +24,17 @@ function cd --wraps=cd --description "Change directory. No args goes to git root
|
||||||
end
|
end
|
||||||
if not test (pwd) = $root
|
if not test (pwd) = $root
|
||||||
__cd_orig $root
|
__cd_orig $root
|
||||||
else
|
else if set -q dirprev
|
||||||
echo "prev: $dirprev[-1]
|
echo "prev: $dirprev[-1]
|
||||||
root: $root"
|
root: $root"
|
||||||
if string match -q "$root" "$dirprev[-1]"
|
set -x smartdirprev $dirprev[-1]
|
||||||
|
set -x smartroot $root
|
||||||
|
if string match -q "$root*" "$dirprev[-1]"
|
||||||
|
echo We out here
|
||||||
__cd_orig -
|
__cd_orig -
|
||||||
|
else
|
||||||
|
set -l prompt "This would take you to $dirprev[-1], which is outside $root, are you sure? (y/n): "
|
||||||
|
echo $prompt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue