mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-14 12:19:51 +00:00
feat(brew): run brew shellenv command at plugin load (#10874)
This commit is contained in:
@@ -1,11 +1,35 @@
|
||||
if (( ! $+commands[brew] )); then
|
||||
if [[ -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"
|
||||
elif [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
|
||||
BREW_LOCATION="/home/linuxbrew/.linuxbrew/bin/brew"
|
||||
elif [[ -x "$HOME/.linuxbrew/bin/brew" ]]; then
|
||||
BREW_LOCATION="$HOME/.linuxbrew/bin/brew"
|
||||
else
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$HOMEBREW_PREFIX" ]]; then
|
||||
if [[ -z $BREW_LOCATION ]]; then
|
||||
eval "$(brew shellenv)"
|
||||
else
|
||||
eval "$("$BREW_LOCATION" shellenv)"
|
||||
fi
|
||||
fi
|
||||
|
||||
unset BREW_LOCATION
|
||||
|
||||
alias bcubc='brew upgrade --cask && brew cleanup'
|
||||
alias bcubo='brew update && brew outdated --cask'
|
||||
alias brewp='brew pin'
|
||||
alias brewsp='brew list --pinned'
|
||||
alias bubo='brew update && brew outdated'
|
||||
alias bubc='brew upgrade && brew cleanup'
|
||||
alias bubo='brew update && brew outdated'
|
||||
alias bubu='bubo && bubc'
|
||||
alias buf='brew upgrade --formula'
|
||||
alias bcubo='brew update && brew outdated --cask'
|
||||
alias bcubc='brew upgrade --cask && brew cleanup'
|
||||
|
||||
function brews() {
|
||||
local formulae="$(brew leaves | xargs brew deps --installed --for-each)"
|
||||
|
||||
Reference in New Issue
Block a user