AutoYADM commit: 2025-04-18 15:45:05

This commit is contained in:
Daniel Fichtinger 2025-04-18 15:45:05 -04:00
parent 68789e68c9
commit e43a7ac777

View file

@ -26,11 +26,10 @@ function cd --wraps=cd --description "Change directory. No args goes to git root
if string match -q "$root*" "$dirprev[-1]" if string match -q "$root*" "$dirprev[-1]"
__cd_orig - __cd_orig -
else else
set -l prompt "$dirprev[-1], is outside $root, are you sure? (y/n): " set -l prompt "$dirprev[-1], is outside $root, are you sure? (y/n):"
while read --nchars 1 -l response --prompt-str="$prompt" or return 1 while read --nchars 1 -l response --prompt-str="$prompt" or return 1
# clear prompt # clear prompt
printf "\033[1A\033[2K" printf "\033[1A\033[2K"
# printf "\033[1A\033[2K"
switch $response switch $response
case y Y case y Y
__cd_orig - __cd_orig -
@ -45,7 +44,11 @@ function cd --wraps=cd --description "Change directory. No args goes to git root
end end
function smartcd_update --description "Update smartcd.fish with the latest from the upstream." function smartcd_update --description "Update smartcd.fish with the latest from the upstream."
curl https://git.sr.ht/~ficd/smartcd.fish/blob/main/smartcd.fish \ argparse d/dry -- $argv
-o $fish_config/conf.d/smartcd.fish set -l url https://git.sr.ht/~ficd/smartcd.fish/blob/main/smartcd.fish
# set -l add "-o $fish_config/conf.d/smartcd.fish"
not set -q _flag_dry; and set -l add -o $fish_config/conf.d/smartcd.fish
curl $url $add
printf "\033[1A\033[2K"
exec fish exec fish
end end