summaryrefslogtreecommitdiff
path: root/plugins/brew/brew.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2023-11-04 18:38:46 -0700
committerTuowen Zhao <ztuowen@gmail.com>2023-11-04 18:38:46 -0700
commit4d908094fdc2a0c0e9a0a072eba213fab7adef43 (patch)
tree7c17e70bcdeebbe96c84d849bdf17882007480d8 /plugins/brew/brew.plugin.zsh
parent4b0bbc0b263a150eb9a9b59f196914629be06a9b (diff)
parent632ed413a9ce62747ded83d7736491b081be4b49 (diff)
downloadzsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.tar.gz
zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.tar.bz2
zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.zip
Merge remote-tracking branch 'github/master'HEADmaster
Diffstat (limited to 'plugins/brew/brew.plugin.zsh')
-rw-r--r--plugins/brew/brew.plugin.zsh11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index f6abe0875..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"
@@ -25,6 +30,10 @@ if [[ -z "$HOMEBREW_PREFIX" ]]; then
export HOMEBREW_PREFIX="$(brew --prefix)"
fi
+if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then
+ fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions")
+fi
+
alias bcubc='brew upgrade --cask && brew cleanup'
alias bcubo='brew update && brew outdated --cask'
alias bcubc='brew upgrade --cask && brew cleanup'