Created
May 23, 2018 13:39
-
-
Save eruffaldi/b88b5867ba3173eceb4e36300263f623 to your computer and use it in GitHub Desktop.
List git folders remote colored
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 | |
RESTORE='\033[0m' | |
RED='\033[00;31m' | |
GREEN='\033[00;32m' | |
YELLOW='\033[00;33m' | |
BLUE='\033[00;34m' | |
PURPLE='\033[00;35m' | |
CYAN='\033[00;36m' | |
LIGHTGRAY='\033[00;37m' | |
for x in $1/*/ ; do | |
q=$(GIT_DIR=$x.git git remote -v 2> /dev/null | grep fetch | awk '{print $2 }') | |
if [ -z "$q" ]; then | |
echo -e $RED $x $RESTORE | |
else | |
echo -e $GREEN $x $YELLOW $q $RESTORE | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment