diff options
author | Marc CornellĂ <marc.cornella@live.com> | 2018-04-19 23:32:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-19 23:32:53 +0200 |
commit | d7948b39dc662c8072a307869135c8a7cae89cf9 (patch) | |
tree | e4fa201ee29415bd31a0e32c3e3a0d9ffed6772e /themes/rkj-repos.zsh-theme | |
parent | 6c9af4455d850a2717d995bf9943b275227c9d99 (diff) | |
download | zsh-d7948b39dc662c8072a307869135c8a7cae89cf9.tar.gz zsh-d7948b39dc662c8072a307869135c8a7cae89cf9.tar.bz2 zsh-d7948b39dc662c8072a307869135c8a7cae89cf9.zip |
[rkj-repos] Make `hg prompt` check less strict (#6746)
* [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.
* [rkj-repos] Check for hg in `hg prompt` function
Diffstat (limited to 'themes/rkj-repos.zsh-theme')
-rw-r--r-- | themes/rkj-repos.zsh-theme | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme index 0d5a166ba..65a075456 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 (( $+commands[hg] )) && grep -q "prompt" ~/.hgrc; then hg prompt --angle-brackets "\ <hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\ </%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ %{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}< patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null + fi } ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" |