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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} | |
function check_git_changes { | |
var=`git status 2> /dev/null | sed -e '/(working directory clean)$/!d' | wc -l` | |
if [ $var -ne 1 ]; then | |
tput setaf 1 # red | |
else | |
tput setaf 2 # green | |
fi |