feat(fish): Add support for checking any git repo

This commit is contained in:
2025-09-08 12:03:08 +02:00
parent f8f9a9fa6b
commit 51f9d628dd

View File

@@ -100,18 +100,24 @@ end
bind -e \cv bind -e \cv
# Check if dotfiles have any updates # Check if any directory has git updates
function check_config_git_status function check_git_status
set config_dir $HOME/.config set target_dir $argv[1]
if test -d $config_dir/.git if test -z "$target_dir"
set dotfiles_status (git -C $config_dir status --porcelain) set target_dir (pwd)
if test -n "$dotfiles_status" end
echo (set_color yellow)"[.config] There are uncommitted changes or untracked files."(set_color normal)
if test -d $target_dir/.git
set git_status (git -C $target_dir status --porcelain)
if test -n "$git_status"
set dir_name (basename $target_dir)
echo (set_color yellow)"[$dir_name] There are uncommitted changes or untracked files."(set_color normal)
end end
end end
end end
check_config_git_status check_git_status $HOME/.config
check_git_status $HOME/.local
# Start tmux by default # Start tmux by default
# if status is-interactive # if status is-interactive