From e63107f6ff508ca94985e59b59d2bcbc1c54dd56 Mon Sep 17 00:00:00 2001 From: laily Date: Mon, 1 Jun 2026 00:23:39 +0800 Subject: [PATCH] fix: ff update --- fish/functions/ff.fish | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/fish/functions/ff.fish b/fish/functions/ff.fish index 2eef722..dd0c1ab 100644 --- a/fish/functions/ff.fish +++ b/fish/functions/ff.fish @@ -82,9 +82,22 @@ function ff printf " %-10s %s\n" $parts[1] $parts[2] end case update - cd ~/.dotfile - git pull origin main - cd - + set -l dotfile_dir ~/.dotfile + if not test -d $dotfile_dir + echo "Error: Dotfile directory not found at $dotfile_dir" + return 1 + end + set -l prev_dir (pwd) + cd $dotfile_dir + if git pull origin main + cd $prev_dir + echo "Reloading fish configuration..." + ff reload + else + cd $prev_dir + echo "Error: git pull failed, skip reload" + return 1 + end case ssh if not functions -q ff_ssh source ~/.dotfile/fish/functions/ff-ssh.fish