2024-07-14 16:18:26 -04:00
|
|
|
# Documentation defined in Library/Homebrew/cmd/formulae.rb
|
2020-10-24 18:34:03 -06:00
|
|
|
|
2021-05-18 17:10:20 +05:30
|
|
|
# HOMEBREW_LIBRARY is set by bin/brew
|
|
|
|
# shellcheck disable=SC2154
|
|
|
|
source "${HOMEBREW_LIBRARY}/Homebrew/items.sh"
|
2020-12-02 17:40:10 +00:00
|
|
|
|
2021-01-08 18:04:51 +08:00
|
|
|
homebrew-formulae() {
|
2023-07-18 12:57:54 +01:00
|
|
|
local find_include_filter='*\.rb'
|
|
|
|
local sed_filter='s|/Formula/(.+/)?|/|'
|
|
|
|
local grep_filter='^homebrew/core'
|
|
|
|
|
2022-12-19 16:30:49 -08:00
|
|
|
# HOMEBREW_CACHE is set by brew.sh
|
|
|
|
# shellcheck disable=SC2154
|
2023-01-18 15:50:13 +00:00
|
|
|
if [[ -z "${HOMEBREW_NO_INSTALL_FROM_API}" &&
|
2023-02-16 21:49:03 +00:00
|
|
|
-f "${HOMEBREW_CACHE}/api/formula_names.txt" ]]
|
2022-12-19 16:30:49 -08:00
|
|
|
then
|
2023-05-20 15:54:48 -07:00
|
|
|
{
|
|
|
|
cat "${HOMEBREW_CACHE}/api/formula_names.txt"
|
|
|
|
echo
|
2023-07-18 12:57:54 +01:00
|
|
|
homebrew-items "${find_include_filter}" '.*Casks(/.*|$)|.*/homebrew/homebrew-core/.*' "${sed_filter}" "${grep_filter}"
|
2023-05-20 15:54:48 -07:00
|
|
|
} | sort -uf
|
2023-02-16 21:49:03 +00:00
|
|
|
else
|
2023-07-18 12:57:54 +01:00
|
|
|
homebrew-items "${find_include_filter}" '.*Casks(/.*|$)' "${sed_filter}" "${grep_filter}"
|
2022-12-19 16:30:49 -08:00
|
|
|
fi
|
2020-11-19 20:27:19 -07:00
|
|
|
}
|