optimize this a bit
diff --git a/themes/doubletime/doubletime.theme.bash b/themes/doubletime/doubletime.theme.bash
index a01bf79..87ced7e 100644
--- a/themes/doubletime/doubletime.theme.bash
+++ b/themes/doubletime/doubletime.theme.bash
@@ -59,14 +59,15 @@
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)"