Skip to content

Commit

Permalink
applied patch provided by @naunga in issue 17. could not apply custom…
Browse files Browse the repository at this point in the history
… symbol via user .bash_profile or .bashrc.
  • Loading branch information
ThatGuyCND committed May 27, 2016
1 parent 7ca4924 commit 5cfb640
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions prompt.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# 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:="|ب_ب|"};

##
# Retreive current GIT branch of local file system
# Based on: http://stackoverflow.com/a/13003854/170413
##
find_git_branch() {
# Based on: http://stackoverflow.com/a/13003854/170413
local branch
if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then
if [[ "$branch" == "HEAD" ]]; then
Expand All @@ -11,10 +18,13 @@ find_git_branch() {
fi
}

##
# Retreive directory status: clean or dirty.
##
find_git_dirty() {
local status=$(git status --porcelain 2> /dev/null)
if [[ "$status" != "" ]]; then
git_dirty='*'
git_dirty=$dirtysymb
else
git_dirty=''
fi
Expand Down

0 comments on commit 5cfb640

Please sign in to comment.