76 lines
1.6 KiB
Bash
Executable file
76 lines
1.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
export HOMEBREW_VERBOSE=1
|
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
|
|
|
alias audt="brew audit --strict --online"
|
|
alias binfo="brew info --github"
|
|
alias broo="HOMEBREW_CACHE=~/.homebrew/cache ~/.homebrew/homebrew/bin/brew"
|
|
alias brwe="brew"
|
|
alias btest="brew test -v --sandbox"
|
|
alias bu="brew update"
|
|
alias bua="brew upgrade"
|
|
alias homebrew='cd $(brew --repository)/Library'
|
|
alias style="brew style --fix"
|
|
alias using="brew uses --installed --recursive"
|
|
|
|
bcd() {
|
|
cd "$(brew --prefix "$1")" || exit
|
|
}
|
|
|
|
# https://github.com/Homebrew/brew/pull/555#issuecomment-234852629
|
|
tcd() {
|
|
local tap="$1"
|
|
[[ "$tap" = */* ]] || tap="homebrew/$tap"
|
|
pushd "$(brew --repository "$tap")"
|
|
}
|
|
|
|
shsm() {
|
|
shsm=$(shasum -a 256 "$1" | sed 's:\ .*::g')
|
|
echo "$shsm"
|
|
echo "$shsm" | pbcopy
|
|
}
|
|
|
|
dshm() {
|
|
local gzsha
|
|
gzsha=$(curl -sL "$1" | ack -o "^\ [^\ ]{64}(?=\ )" | head -n1 | tr -d ' ')
|
|
echo "$gzsha"
|
|
echo "$gzsha" | tr -d '\n' | pbcopy
|
|
}
|
|
|
|
brewp() {
|
|
for f in "$@"; do
|
|
f="$(echo $f | sed 's:(installed)::g')"
|
|
if [ "$f" != "" ]; then
|
|
brew home "$f" && \
|
|
brew info --github "$f" && \
|
|
# strip out tap prefixes
|
|
brew search --debian "$(echo "$f" | sed 's:.*/\([^/]*\)$:\1:')"
|
|
fi
|
|
done
|
|
}
|
|
alias brwep="brewp"
|
|
|
|
bo() {
|
|
for f in "$@"; do
|
|
open "$(brew --prefix "$f")"
|
|
done
|
|
}
|
|
|
|
bi() {
|
|
brew remove "$1"
|
|
brew install --verbose --build-from-source "$@"
|
|
}
|
|
|
|
brm() {
|
|
for app in "$@"; do
|
|
using=$(using "$app")
|
|
if [[ "$using" == "" ]]; then
|
|
brew remove "$app"
|
|
else
|
|
echo "$(tput setaf 166) $app is being used by:$(tput sgr0)"
|
|
echo "$using"
|
|
fi
|
|
done
|
|
}
|