diff --git a/fish/config.fish b/fish/config.fish index bd63c5d..376e2a2 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -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