cmd/formulae,cmd/casks: include casks/formulae in local non-core taps when the API is used

Fixes #15229
This commit is contained in:
Omoeba 2023-05-20 15:54:48 -07:00
parent 106a61c0a6
commit b43ed6e765
No known key found for this signature in database
GPG Key ID: 3E6DB79EF9F6FD28
2 changed files with 12 additions and 6 deletions

View File

@ -13,9 +13,12 @@ homebrew-casks() {
if [[ -z "${HOMEBREW_NO_INSTALL_FROM_API}" &&
-f "${HOMEBREW_CACHE}/api/cask_names.txt" ]]
then
{
cat "${HOMEBREW_CACHE}/api/cask_names.txt"
echo
homebrew-items '*/Casks/*\.rb' '.*/homebrew/homebrew-cask/.*' 's|/Casks/|/|' '^homebrew/cask'
} | sort -uf
else
homebrew-items '*/Casks/*\.rb' '' 's|/Casks/|/|' '^homebrew/cask'
homebrew-items '*/Casks/*\.rb' '^\b$' 's|/Casks/|/|' '^homebrew/cask'
fi
}

View File

@ -13,9 +13,12 @@ homebrew-formulae() {
if [[ -z "${HOMEBREW_NO_INSTALL_FROM_API}" &&
-f "${HOMEBREW_CACHE}/api/formula_names.txt" ]]
then
{
cat "${HOMEBREW_CACHE}/api/formula_names.txt"
echo
homebrew-items '*\.rb' '.*Casks(/.*|$)|.*/homebrew/homebrew-core/.*' 's|/Formula/|/|' '^homebrew/core'
} | sort -uf
else
homebrew-items '*\.rb' 'Casks' 's|/Formula/|/|' '^homebrew/core'
homebrew-items '*\.rb' '.*Casks(/.*|$)' 's|/Formula/|/|' '^homebrew/core'
fi
}