Created
February 15, 2017 18:59
-
-
Save pankajpatel/161f859949458dcf84cc44ea0e910fd1 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 | |
echo "Brahch Listing" | |
cd /c/xampp/htdocs/ | |
RED='\033[0;31m' | |
BLUE='\033[1;34m' | |
GREEN='\033[1;32m' | |
NC='\033[0m' # No Color | |
for i in $( ls ); do | |
cd $i | |
if [ $? -eq 0 ]; then | |
# echo $i | |
output="$i" | |
git rev-parse --abbrev-ref HEAD &> /dev/null | |
if [ $? -eq 0 ]; then | |
# output="$output $x" | |
x="$(git rev-parse --abbrev-ref HEAD)" | |
printf "${BLUE}$output\t${GREEN}$x" | |
else | |
printf "${BLUE}$output\t${RED}--" | |
fi | |
printf "\n" | |
cd .. | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment