summaryrefslogtreecommitdiff
path: root/plugins/brew/brew.plugin.zsh
diff options
context:
space:
mode:
authorCarlo Sala <carlosalag@protonmail.com>2023-09-13 10:48:16 +0200
committerCarlo Sala <carlosalag@protonmail.com>2023-09-13 10:48:41 +0200
commit7e4c26860d74a01cd6d91fd10fcc28fccd740ddd (patch)
tree9c180418f1b3ad1557c06844b00c64b9f5cf62ae /plugins/brew/brew.plugin.zsh
parent01f55123118601a935f28ff6c49e625448bdd32d (diff)
downloadzsh-7e4c26860d74a01cd6d91fd10fcc28fccd740ddd.tar.gz
zsh-7e4c26860d74a01cd6d91fd10fcc28fccd740ddd.tar.bz2
zsh-7e4c26860d74a01cd6d91fd10fcc28fccd740ddd.zip
feat(brew): add support for custom `BREW_LOCATION`
Fixes #11888 Co-authored-by: Matt Cable <github@curiousstranger.org>
Diffstat (limited to 'plugins/brew/brew.plugin.zsh')
-rw-r--r--plugins/brew/brew.plugin.zsh7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index b52664a39..447036376 100644
--- a/plugins/brew/brew.plugin.zsh
+++ b/plugins/brew/brew.plugin.zsh
@@ -1,5 +1,10 @@
if (( ! $+commands[brew] )); then
- if [[ -x /opt/homebrew/bin/brew ]]; then
+ if [[ -n "$BREW_LOCATION" ]]; then
+ if [[ ! -x "$BREW_LOCATION" ]]; then
+ echo "[oh-my-zsh] $BREW_LOCATION is not executable"
+ return
+ fi
+ elif [[ -x /opt/homebrew/bin/brew ]]; then
BREW_LOCATION="/opt/homebrew/bin/brew"
elif [[ -x /usr/local/bin/brew ]]; then
BREW_LOCATION="/usr/local/bin/brew"