Created
September 12, 2015 10:56
-
-
Save MightyPork/c73648e9324c7a8e11b0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| source .bash_colors | |
| export PROMPT_DIRTRIM=2 | |
| function _branch_ps1 { | |
| _branch="" | |
| if [ -d .git ]; then | |
| _br=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD) | |
| if [ $_br == "master" ]; then | |
| _branch="${BIRed}$_br${Reset} " | |
| elif [ $_br == "testing" ]; then | |
| _branch="${BGreen}$_br${Reset} " | |
| else | |
| _branch="${BCyan}$_br${Reset} " | |
| fi | |
| fi | |
| export PS1="$_branch${BBlue}\w \\$ ${Reset}" | |
| } | |
| export PROMPT_COMMAND=_branch_ps1 | |
| # init prompt | |
| _branch_ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment