brew/Library/Homebrew/cmd/formulae.sh

12 lines
521 B
Bash
Raw Normal View History

2020-11-19 20:18:08 -07:00
#: * `formulae` [<options>]
2020-11-19 20:27:19 -07:00
#:
#: List all locally installable formulae including short names.
2020-10-24 18:34:03 -06:00
#:
# shellcheck disable=SC2155
homebrew-formulae() {
2020-11-19 20:18:08 -07:00
local formulae="$(\find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' | \sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')"
local shortnames="$(echo "$formulae" | \cut -d / -f 3)"
echo -e "$formulae \n $shortnames" | \grep -v '^homebrew/' | \sort -uf
2020-11-19 20:27:19 -07:00
}