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
# Check if dotfiles have any updates
function check_config_git_status
set config_dir $HOME/.config
if test -d $config_dir/.git
set dotfiles_status (git -C $config_dir status --porcelain)
if test -n "$dotfiles_status"
echo (set_color yellow)"[.config] There are uncommitted changes or untracked files."(set_color normal)
# Check if any directory has git updates
function check_git_status
set target_dir $argv[1]
if test -z "$target_dir"
set target_dir (pwd)
end
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
check_config_git_status
check_git_status $HOME/.config
check_git_status $HOME/.local
# Start tmux by default
# if status is-interactive