2020-11-19 20:50:34 -07:00
|
|
|
#: * `formulae`
|
2020-11-19 20:27:19 -07:00
|
|
|
#:
|
|
|
|
#: List all locally installable formulae including short names.
|
2020-10-24 18:34:03 -06:00
|
|
|
#:
|
|
|
|
|
|
|
|
homebrew-formulae() {
|
2020-11-19 20:33:18 -07:00
|
|
|
local formulae
|
2020-12-02 17:40:10 +00:00
|
|
|
local sed_extended_regex_flag
|
|
|
|
|
|
|
|
if [[ -n "$HOMEBREW_MACOS" ]]; then
|
|
|
|
sed_extended_regex_flag="-E"
|
|
|
|
else
|
|
|
|
sed_extended_regex_flag="-r"
|
|
|
|
fi
|
|
|
|
|
2020-11-20 12:43:38 +00:00
|
|
|
formulae="$( \
|
|
|
|
find "$HOMEBREW_REPOSITORY/Library/Taps" \
|
|
|
|
-type d \( \
|
|
|
|
-name Casks -o \
|
|
|
|
-name cmd -o \
|
|
|
|
-name .github -o \
|
|
|
|
-name lib -o \
|
|
|
|
-name spec -o \
|
|
|
|
-name vendor \
|
|
|
|
\) \
|
|
|
|
-prune -false -o -name '*\.rb' | \
|
2020-12-02 17:40:10 +00:00
|
|
|
sed "$sed_extended_regex_flag" \
|
|
|
|
-e 's/\.rb//g' \
|
|
|
|
-e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' \
|
|
|
|
-e 's|/Formula/|/|' \
|
2020-11-20 12:43:38 +00:00
|
|
|
)"
|
2020-11-19 20:33:18 -07:00
|
|
|
local shortnames
|
2020-11-20 12:43:38 +00:00
|
|
|
shortnames="$(echo "$formulae" | cut -d "/" -f 3)"
|
2020-12-01 12:59:32 -06:00
|
|
|
echo -e "$formulae\n$shortnames" | \
|
2020-11-20 12:43:38 +00:00
|
|
|
grep -v '^homebrew/core' | \
|
|
|
|
sort -uf
|
2020-11-19 20:27:19 -07:00
|
|
|
}
|