Permalink
Browse files

Use `grep -q` for silent behavior

  • Loading branch information...
1 parent e1b04cf commit 82a4587427ea8246bf74858ace489c81690c3c28 @mcornella mcornella committed Apr 4, 2016
Showing with 7 additions and 7 deletions.
  1. +7 −7 themes/bureau.zsh-theme
@@ -28,16 +28,16 @@ bureau_git_status() {
# check status of files
_INDEX=$(command git status --porcelain 2> /dev/null)
if [[ -n "$_INDEX" ]]; then
- if $(echo "$_INDEX" | command grep '^[AMRD]. ' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^[AMRD]. '); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
fi
- if $(echo "$_INDEX" | command grep '^.[MTD] ' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^.[MTD] '); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED"
fi
- if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q -E '^\?\? '); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED"
fi
- if $(echo "$_INDEX" | command grep '^UU ' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^UU '); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED"
fi
else
@@ -46,13 +46,13 @@ bureau_git_status() {
# check status of local repository
_INDEX=$(command git status --porcelain -b 2> /dev/null)
- if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^## .*ahead'); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
- if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^## .*behind'); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
- if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then
+ if $(echo "$_INDEX" | command grep -q '^## .*diverged'); then
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED"
fi

0 comments on commit 82a4587

Please sign in to comment.