diff options
author | Carlo Sala <carlosalag@protonmail.com> | 2023-09-13 10:48:16 +0200 |
---|---|---|
committer | Carlo Sala <carlosalag@protonmail.com> | 2023-09-13 10:48:41 +0200 |
commit | 7e4c26860d74a01cd6d91fd10fcc28fccd740ddd (patch) | |
tree | 9c180418f1b3ad1557c06844b00c64b9f5cf62ae /plugins/brew/brew.plugin.zsh | |
parent | 01f55123118601a935f28ff6c49e625448bdd32d (diff) | |
download | zsh-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.zsh | 7 |
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" |