From 73ed8a1af74805e72a81c329fb9fac35b154d600 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 29 Aug 2012 18:20:42 +0200 Subject: [PATCH] zsh/rc: Create program functions only if the programs are installed. --- zsh/rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zsh/rc b/zsh/rc index ca12596..e34d905 100644 --- a/zsh/rc +++ b/zsh/rc @@ -655,17 +655,17 @@ fi # Display all branches (except stash) in gitk but only 200 commits as this is # much faster. Also put in the background and disown. Thanks to drizzd in #git # on Freenode (2010-04-03 17:55 CEST). -gitk() { +(( $+commands[gitk] )) && gitk() { command gitk --max-count=200 --branches --remotes --tags "$@" & disown %command } # Same for tig (except the disown part as it's no GUI program). -tig() { +(( $+commands[tig] )) && tig() { command tig --max-count=200 --branches --remotes --tags "$@" } # Pipe output through less. -tree() { +(( $+commands[tree] )) && tree() { command tree -C "$@" | less } -- 2.44.2