summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorDawnflash Lightstring <adamzahumensky@gmail.com>2016-09-21 12:20:08 +0200
committerGitHub <noreply@github.com>2016-09-21 12:20:08 +0200
commit7e5483d672aab9764231d9a569b6c7451474eecb (patch)
tree6050e1a481fe4946462e13369ce180d8fcd05afe /themes
parentf39dcfda8d287bdfeda2bc1e0a7ab3785c6e4a73 (diff)
downloadzsh-7e5483d672aab9764231d9a569b6c7451474eecb.tar.gz
zsh-7e5483d672aab9764231d9a569b6c7451474eecb.tar.bz2
zsh-7e5483d672aab9764231d9a569b6c7451474eecb.zip
Add check for git and bzr to agnoster theme
Plugin command-not-found on Arch Linux returns 0 if git or bzr is found in repos, hence outputting unwanted pkgfile output. Checking if the commands exist first fixes all such issues.
Diffstat (limited to 'themes')
-rw-r--r--themes/agnoster.zsh-theme3
1 files changed, 2 insertions, 1 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index e1a294ee8..07546fd34 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -86,7 +86,7 @@ prompt_context() {
# Git: branch/detached head, dirty status
prompt_git() {
-
+ (( $+commands[git] )) || return
local PL_BRANCH_CHAR
() {
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
@@ -128,6 +128,7 @@ prompt_git() {
}
prompt_bzr() {
+ (( $+commands[bzr] )) || return
if (bzr status >/dev/null 2>&1); then
status_mod=`bzr status | head -n1 | grep "modified" | wc -m`
status_all=`bzr status | head -n1 | wc -m`