ambevar-dotfiles/.scripts/git-check

25 lines
406 B
Bash
Executable File

#!/bin/sh
_usage() {
cat<<EOF
Usage: ${0##*/} FOLDERS
Chack all git repos found in FOLDERS for non-commited file.
EOF
}
if [ $# -eq 0 ] || [ "$1" = "-h" ]; then
_usage
exit
fi
for i; do
while IFS= read -r FOLDER; do
if [ -z "$(cd -- "${FOLDER%/*}" && LC_ALL=C git status -uno | grep "nothing to commit")" ]; then
echo "${FOLDER%/*}"
fi
done <<EOF
$(find "$i" -type d -name ".git")
EOF
done