diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh index f31ccd576..c970fd585 100644 --- a/plugins/z/z.plugin.zsh +++ b/plugins/z/z.plugin.zsh @@ -1,6 +1,8 @@ -if [ -f `brew --prefix`/etc/profile.d/z.sh ]; then - . `brew --prefix`/etc/profile.d/z.sh - function precmd () { - z --add "$(pwd -P)" - } +if [ $( which brew ) ]; then + if [ -f `brew --prefix`/etc/profile.d/z.sh ]; then + . `brew --prefix`/etc/profile.d/z.sh + function precmd () { + z --add "$(pwd -P)" + } + fi fi