Skip to content

Commit

Permalink
optimize this a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
tswicegood committed May 1, 2012
1 parent e51c7fb commit b7e429b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions themes/doubletime/doubletime.theme.bash
Expand Up @@ -59,14 +59,15 @@ $(doubletime_scm_prompt)$reset_color $ "
PROMPT_COMMAND=prompt_setter

git_prompt_status() {

if [ -n "$(git status | grep 'Changes not staged' 2> /dev/null)" ]; then
local git_status_output
git_status_output=$(git status 2> /dev/null )
if [ -n "$(echo $git_status_output | grep 'Changes not staged')" ]; then
git_status="${bold_red}$(scm_prompt_info)"
elif [ -n "$(git status | grep 'Changes to be committed' 2> /dev/null)" ]; then
elif [ -n "$(echo $git_status_output | grep 'Changes to be committed')" ]; then
git_status="${bold_yellow}$(scm_prompt_info) ^"
elif [ -n "$(git status | grep 'Untracked files' 2> /dev/null)" ]; then
elif [ -n "$(echo $git_status_output | grep 'Untracked files')" ]; then
git_status="${bold_cyan}$(scm_prompt_info) +"
elif [ -n "$(git status | grep 'nothing to commit' 2> /dev/null)" ]; then
elif [ -n "$(echo $git_status_output | grep 'nothing to commit')" ]; then
git_status="${bold_green}$(scm_prompt_info) ${green}"
else
git_status="$(scm_prompt_info)"
Expand Down

0 comments on commit b7e429b

Please sign in to comment.