82a4587427ea8246bf74858ace489c81690c3c28

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Use `grep -q` for silent behavior

Diff

 1diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme
 2index 9b1759c1b32936d2d84611b96efa3ca824129827..3b3bdc80f3183da358a6ef1720bc0ed4f8f7dda5 100644
 3--- a/themes/bureau.zsh-theme
 4+++ b/themes/bureau.zsh-theme
 5@@ -28,16 +28,16 @@ bureau_git_status() {
 6   # check status of files
 7   _INDEX=$(command git status --porcelain 2> /dev/null)
 8   if [[ -n "$_INDEX" ]]; then
 9-    if $(echo "$_INDEX" | command grep '^[AMRD]. ' &> /dev/null); then
10+    if $(echo "$_INDEX" | command grep -q '^[AMRD]. '); then
11       _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
12     fi
13-    if $(echo "$_INDEX" | command grep '^.[MTD] ' &> /dev/null); then
14+    if $(echo "$_INDEX" | command grep -q '^.[MTD] '); then
15       _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED"
16     fi
17-    if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then
18+    if $(echo "$_INDEX" | command grep -q -E '^\?\? '); then
19       _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED"
20     fi
21-    if $(echo "$_INDEX" | command grep '^UU ' &> /dev/null); then
22+    if $(echo "$_INDEX" | command grep -q '^UU '); then
23       _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED"
24     fi
25   else
26@@ -46,13 +46,13 @@ bureau_git_status() {
27 
28   # check status of local repository
29   _INDEX=$(command git status --porcelain -b 2> /dev/null)
30-  if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then
31+  if $(echo "$_INDEX" | command grep -q '^## .*ahead'); then
32     _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
33   fi
34-  if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then
35+  if $(echo "$_INDEX" | command grep -q '^## .*behind'); then
36     _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
37   fi
38-  if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then
39+  if $(echo "$_INDEX" | command grep -q '^## .*diverged'); then
40     _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED"
41   fi
42