ambevar-dotfiles/.scripts/git-check

22 lines
368 B
Bash
Executable File

#!/bin/sh
usage () {
cat <<EOF>&2
Usage: ${0##*/} FOLDERS
Chack all FOLDERS for a git repo with non-commited files.
EOF
}
[ $# -eq 0 ] && usage && exit 1
[ "$1" = "-h" ] && usage && exit
[ "$1" = "--" ] && shift
for i; do
cd "$i" || continue
if [ -d ".git" ]; then
LC_ALL=C git status -uno | grep -q "nothing to commit" || echo "$i"
fi
cd - >/dev/null
done