Created
October 2, 2013 19:18
-
-
Save lejeunerenard/6799088 to your computer and use it in GitHub Desktop.
Prompt Environment String for Bash
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
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\w$(git branch &>/dev/null;\ | |
if [ $? -eq 0 ]; then \ | |
echo "$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; \ | |
if [ "$?" -eq "0" ]; then \ | |
# @4 - Clean repository - nothing to commit | |
echo "⚡"; \ | |
else \ | |
# @5 - Changes to working tree | |
echo "\[\033[31m\]⚡\[\033[01;00m\]"; \ | |
fi)"; \ | |
else \ | |
# @2 - Prompt when not in GIT repo | |
echo "⚡"; \ | |
fi) ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment