From 6c7a0457949aecbd3b7c576f208a89caf4b55ed6 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 2 Oct 2015 16:54:50 -0700 Subject: [PATCH 1/2] Cleaned up logic in bureau_git_prompt function --- themes/bureau.zsh-theme | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 3b3bdc80f..2adb9e913 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -64,17 +64,16 @@ bureau_git_status() { } bureau_git_prompt () { - local _branch=$(bureau_git_branch) - local _status=$(bureau_git_status) - local _result="" - if [[ "${_branch}x" != "x" ]]; then - _result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch" - if [[ "${_status}x" != "x" ]]; then + if git rev-parse --git-dir > /dev/null 2>&1; then + local _branch=$(bureau_git_branch) + local _status=$(bureau_git_status) + local _result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch" + if [[ -n "$_status" ]]; then _result="$_result $_status" fi _result="$_result$ZSH_THEME_GIT_PROMPT_SUFFIX" + echo $_result fi - echo $_result } From d80d393abaf74ed0445841a80a8914740bf69fe8 Mon Sep 17 00:00:00 2001 From: Steven Spasbo Date: Fri, 1 Apr 2016 01:10:18 -0700 Subject: [PATCH 2/2] Added command wrapper --- themes/bureau.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 2adb9e913..8838f1639 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -64,7 +64,7 @@ bureau_git_status() { } bureau_git_prompt () { - if git rev-parse --git-dir > /dev/null 2>&1; then + if $(command git rev-parse --git-dir > /dev/null 2>&1); then local _branch=$(bureau_git_branch) local _status=$(bureau_git_status) local _result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch"