From 110f40791583ca0e3b82e671badb52bde602d716 Mon Sep 17 00:00:00 2001 From: Anton Kuroedov Date: Wed, 20 Jul 2016 22:18:57 +0300 Subject: [PATCH] Using idiomatic zsh way to check if hg is present --- themes/agnoster.zsh-theme | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 11641fb5d..da1f9b6e6 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -128,9 +128,7 @@ prompt_git() { } prompt_hg() { - if ! type hg &> /dev/null; then - return - fi + (( $+commands[hg] )) || return local rev status if $(hg id >/dev/null 2>&1); then if $(hg prompt >/dev/null 2>&1); then