aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-06-09 23:55:59 +1200
committerTom Ryder <tom@sanctum.geek.nz>2012-06-09 23:55:59 +1200
commit7e02b3d09ad9bf36b58b8c5720d69eed6c2cf39c (patch)
tree36858da0994c22f4f1537745a03182b996f2040e /bash
parentAdd nonzero jobs count to prompt (diff)
downloaddotfiles-7e02b3d09ad9bf36b58b8c5720d69eed6c2cf39c.tar.gz
dotfiles-7e02b3d09ad9bf36b58b8c5720d69eed6c2cf39c.zip
Suppress all errors
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc17
1 files changed, 10 insertions, 7 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 4299b8b4..fde516b3 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -90,8 +90,9 @@ fi
# Function to display branch of a Git repository.
function prompt_git {
git branch &>/dev/null || return 1
- BRANCH="$(git symbolic-ref HEAD)"
- [[ -n "$(git status | grep 'working directory clean')" ]] || STATUS="!"
+ BRANCH="$(git symbolic-ref HEAD 2>/dev/null)"
+ [[ -n "$(git status 2>/dev/null | \
+ grep 'working directory clean')" ]] || STATUS="!"
echo -n "(git:${BRANCH##*/}${STATUS})"
return 0
}
@@ -99,9 +100,11 @@ function prompt_git {
# Function to display branch of an SVN working copy.
function prompt_svn {
svn info &>/dev/null || return 1
- URL="$(svn info | awk -F': ' '$1 == "URL" {print $2}')"
- ROOT="$(svn info | awk -F': ' '$1 == "Repository Root" {print $2}')/"
- [[ -n "$(svn status)" ]] && STATUS="!"
+ URL="$(svn info 2>/dev/null | \
+ awk -F': ' '$1 == "URL" {print $2}')"
+ ROOT="$(svn info 2>/dev/null | \
+ awk -F': ' '$1 == "Repository Root" {print $2}')/"
+ [[ -n "$(svn status 2>/dev/null)" ]] && STATUS="!"
echo -n "(svn:${URL/$ROOT}${STATUS})"
return 0
}
@@ -109,8 +112,8 @@ function prompt_svn {
# Function to display branch of a Mercurial repository.
function prompt_hg {
hg branch &>/dev/null || return 1
- BRANCH="$(hg branch)"
- [[ -n "$(hg status)" ]] && STATUS="!"
+ BRANCH="$(hg branch 2>/dev/null)"
+ [[ -n "$(hg status 2>/dev/null)" ]] && STATUS="!"
echo -n "(hg:${BRANCH}${STATUS})"
return 0
}