From e43a7ac7776c4ea146413c977745829a868847dc Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Apr 2025 15:45:05 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-18 15:45:05 --- .config/fish/conf.d/smartcd.fish | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/fish/conf.d/smartcd.fish b/.config/fish/conf.d/smartcd.fish index ff2640ea..68fffbf5 100644 --- a/.config/fish/conf.d/smartcd.fish +++ b/.config/fish/conf.d/smartcd.fish @@ -26,11 +26,10 @@ function cd --wraps=cd --description "Change directory. No args goes to git root if string match -q "$root*" "$dirprev[-1]" __cd_orig - 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 # clear prompt printf "\033[1A\033[2K" - # printf "\033[1A\033[2K" switch $response case y Y __cd_orig - @@ -45,7 +44,11 @@ function cd --wraps=cd --description "Change directory. No args goes to git root end 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 \ - -o $fish_config/conf.d/smartcd.fish + argparse d/dry -- $argv + 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 end