diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2023-11-04 18:38:46 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2023-11-04 18:38:46 -0700 |
commit | 4d908094fdc2a0c0e9a0a072eba213fab7adef43 (patch) | |
tree | 7c17e70bcdeebbe96c84d849bdf17882007480d8 /plugins/brew/brew.plugin.zsh | |
parent | 4b0bbc0b263a150eb9a9b59f196914629be06a9b (diff) | |
parent | 632ed413a9ce62747ded83d7736491b081be4b49 (diff) | |
download | zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.tar.gz zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.tar.bz2 zsh-4d908094fdc2a0c0e9a0a072eba213fab7adef43.zip |
Diffstat (limited to 'plugins/brew/brew.plugin.zsh')
-rw-r--r-- | plugins/brew/brew.plugin.zsh | 11 |
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' |