2022-07-12 18:40:39 +02:00
|
|
|
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'
|
2018-08-29 20:53:24 +02:00
|
|
|
alias brewp='brew pin'
|
|
|
|
alias brewsp='brew list --pinned'
|
2015-05-31 19:34:01 +02:00
|
|
|
alias bubc='brew upgrade && brew cleanup'
|
2022-07-12 18:40:39 +02:00
|
|
|
alias bubo='brew update && brew outdated'
|
2015-05-31 19:34:01 +02:00
|
|
|
alias bubu='bubo && bubc'
|
2020-09-28 22:24:31 +02:00
|
|
|
alias buf='brew upgrade --formula'
|
2021-12-18 01:15:39 +01:00
|
|
|
|
|
|
|
function brews() {
|
|
|
|
local formulae="$(brew leaves | xargs brew deps --installed --for-each)"
|
|
|
|
local casks="$(brew list --cask)"
|
|
|
|
|
|
|
|
local blue="$(tput setaf 4)"
|
|
|
|
local bold="$(tput bold)"
|
|
|
|
local off="$(tput sgr0)"
|
|
|
|
|
|
|
|
echo "${blue}==>${off} ${bold}Formulae${off}"
|
|
|
|
echo "${formulae}" | sed "s/^\(.*\):\(.*\)$/\1${blue}\2${off}/"
|
|
|
|
echo "\n${blue}==>${off} ${bold}Casks${off}\n${casks}"
|
|
|
|
}
|