Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Roberts committed Apr 15, 2014
1 parent a3e78ca commit 1a16898
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions prompt.sh
@@ -1,26 +1,23 @@
#!/bin/sh
EDITED_BRANCH_COLOR='\[\e[0;31m\]'
CLEAN_BRANCH_COLOR='\[\e[0;32m\]'
NORMAL_COLOR='\033[33;0m'
red='\033[33;31m';
green='\033[33;32m';
dirty_color='\033[33;35m';

EDITED_BRANCH_COLOR=$red
CLEAN_BRANCH_COLOR=$red

NORMAL_COLOR='\033[33;0m'

function parse_git_branch {
ref=$(git symbolic-ref --short HEAD 2> /dev/null) || return
#echo "(${ref})"
# echo "\$()"
echo -e "[$(cleanliness_color)${ref}${NORMAL_COLOR}] "
}

function cleanliness_color {
status=$(git status | sed -n '/\(working directory clean\)/p') || return
if [ -n "${status}" ]; then
echo -e "${green}"
#echo ${CLEAN_BRANCH_COLOR}
echo -e "${EDITED_BRANCH_COLOR}"
else
echo -e "${red}"
#echo ${EDITED_BRANCH_COLOR}
echo -e "${CLEAN_BRANCH_COLOR}"
fi
}

Expand Down

0 comments on commit 1a16898

Please sign in to comment.