diff --git a/README.md b/README.md index 936ca9d..e7ad48c 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ your `PS1` variable, and make sure the variable value is defined with double quotes. A set of color variables have also been set for you to use. For a list of available colors check `colors.sh`. +If you would like to use a symbol other than '*' to indicate that the branch is +dirty, simply set the `dirtysmb` to whatever symbol you would like and export it. ## Updating diff --git a/prompt.sh b/prompt.sh index 6a737b8..2ac3650 100644 --- a/prompt.sh +++ b/prompt.sh @@ -1,3 +1,7 @@ +# Users can set the dirtysymb env var in their .bash_profile, etc, +# or they can leave it unset and it will default to the '*'. +export dirtysymb=${dirtysymb:="*"}; + find_git_branch() { # Based on: http://stackoverflow.com/a/13003854/170413 local branch @@ -14,7 +18,7 @@ find_git_branch() { find_git_dirty() { local status=$(git status --porcelain 2> /dev/null) if [[ "$status" != "" ]]; then - git_dirty='*' + git_dirty=$dirtysymb else git_dirty='' fi