Created
April 17, 2012 07:09
-
-
Save garrow/2404124 to your computer and use it in GitHub Desktop.
Nice changing prompt character, based on the current repository type.
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 prompt_char { | |
if [[ -d './.svn/' ]]; then echo '§' && return; fi | |
# it's faster to test for a `./.svn` directory than | |
# to exec `svn` & check return codes | |
git branch >/dev/null 2>&1 && echo '±' && return | |
hg root >/dev/null 2>&1 && echo '☿' && return | |
# redirect output of commands to /dev/null & | |
# echo custom char based on successful execution | |
echo '○' | |
# Fallback to default | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment