From 332698fdc5fac780635905190c5241a5c859534d Mon Sep 17 00:00:00 2001 From: Joe Moon Date: Thu, 29 Sep 2016 19:45:26 -0700 Subject: [PATCH] minimize number of calls to `brew` --- bin/autojump.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/autojump.zsh b/bin/autojump.zsh index 92c31d7..79f7cd2 100644 --- a/bin/autojump.zsh +++ b/bin/autojump.zsh @@ -10,8 +10,9 @@ fi # set homebrew installation paths -if command -v brew &>/dev/null && [[ -d "$(brew --prefix)/share/zsh/site-functions" ]]; then - fpath=("$(brew --prefix)/share/zsh/site-functions" ${fpath}) +local brew_prefix=${BREW_PREFIX:-$(brew --prefix)} +if [[ -d "${brew_prefix}/share/zsh/site-functions" ]]; then + fpath=("${brew_prefix}/share/zsh/site-functions" ${fpath}) fi