Files
.config/fish/functions/check_git_status.fish

15 lines
440 B
Fish

# 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