Created
September 3, 2014 03:22
-
-
Save bellcliff/47effba1b9c4ab8d1b79 to your computer and use it in GitHub Desktop.
working on ios
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
| sed need one more parameter | |
| bash_profile will be loaded, not profile or bashrc | |
| PS1 need export | |
| function parse_git_branch() { | |
| branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) | |
| if [[ -z "$branch" ]]; then return; fi | |
| if [[ -z "$(git status -s 2>/dev/null)" ]]; then | |
| color=$'\e[1;32m' | |
| else | |
| color=$'\e[1;31m' | |
| fi | |
| echo "\[$color\] (${branch}) " | |
| } | |
| export PS1="\e[0;34m[\$(date +%k:%M:%S)]\e[0m \u@\h: \w $(parse_git_branch)\[\e[0m\]\n => " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment