Created
May 2, 2015 18:31
-
-
Save leedo/ecf1b87e30d3a7c064c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
for dir in $(find "$1" -maxdepth 1 -type d); do | |
if [ -d "$dir/.git" ]; then | |
dirty=$(git -C "$dir" diff --shortstat 2> /dev/null | tail -n 1) | |
if [[ $dirty != "" ]]; then | |
printf "$RED%s$NC\n" $(basename "$dir") | |
else | |
printf "$GREEN%s$NC\n" $(basename "$dir") | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment