From 6e24ba5a13953202e82612e510109a248ccd8cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 19 Apr 2018 19:48:52 +0200 Subject: [PATCH] [rkj-repos] Make `hg prompt` check less strict Move the `hg prompt` check inside the hg_prompt_info function so that it returns an empty string if hg-prompt isn't installed. Fixes #6743. --- themes/rkj-repos.zsh-theme | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index 0d5a166ba..fb2aa1bad 100644 --- a/themes/rkj-repos.zsh-theme +++ b/themes/rkj-repos.zsh-theme @@ -1,16 +1,13 @@ # user, host, full path, and time/date on two lines for easier vgrepping -if ! grep -q "prompt" ~/.hgrc; then - echo "This theme requires 'hg prompt' (https://bitbucket.org/sjl/hg-prompt/overview)" - return 1 -fi - function hg_prompt_info { + if grep -q "prompt" ~/.hgrc; then hg prompt --angle-brackets "\ %{$reset_color%}><:%{$fg[magenta]%}%{$reset_color%}>\ %{$reset_color%}>\ %{$fg[red]%}%{$reset_color%}< patches: >" 2>/dev/null + fi } ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+"