From ce93ba5d20a41cdcf203f6ce518f0a4874176182 Mon Sep 17 00:00:00 2001 From: Ben O'Hara Date: Sun, 17 Jun 2012 14:41:03 +1000 Subject: [PATCH] Exit the module if the required commands arnt installed so aliases arnt set that wont work --- modules/git/init.zsh | 4 ++++ modules/rsync/init.zsh | 4 ++++ modules/screen/init.zsh | 4 ++++ modules/tmux/init.zsh | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/modules/git/init.zsh b/modules/git/init.zsh index e3c3ac84..cf15851e 100644 --- a/modules/git/init.zsh +++ b/modules/git/init.zsh @@ -5,6 +5,10 @@ # Sorin Ionescu # +if (( ! $+commands[git] )); then + return 1 +fi + # Source module files. source "${0:h}/alias.zsh" source "${0:h}/hub.zsh" diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index e0f866a8..2117e20e 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -5,6 +5,10 @@ # Sorin Ionescu # +if (( ! $+commands[rsync] )); then + return 1 +fi + # Aliases _rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index 8c0f1d57..f1275495 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -5,6 +5,10 @@ # Sorin Ionescu # +if (( ! $+commands[screen] )); then + return 1 +fi + # Aliases alias sl="screen -list" alias sn="screen -U -S" diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index c066ea98..7d3b266e 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -6,6 +6,10 @@ # Colin Hebert # +if (( ! $+commands[tmux] )); then + return 1 +fi + # Aliases alias ta="tmux attach-session" alias tl="tmux list-sessions"