ambevar-dotfiles/.scripts/git-check

25 lines
406 B
Plaintext
Raw Normal View History

#!/bin/sh
_usage() {
cat<<EOF
2013-10-23 10:56:28 +02:00
Usage: ${0##*/} FOLDERS
Chack all git repos found in FOLDERS for non-commited file.
EOF
}
if [ $# -eq 0 ] || [ "$1" = "-h" ]; then
_usage
exit
2013-10-23 10:56:28 +02:00
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
2013-10-23 10:56:28 +02:00
$(find "$i" -type d -name ".git")
EOF
2013-10-23 10:56:28 +02:00
done