Merge pull request #16713 from reitermarkus/tap-formula-files

Support `Tap#formula_files` when using API.
This commit is contained in:
Mike McQuaid 2024-02-22 08:46:37 +00:00 committed by GitHub
commit 318256c0b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 23 deletions

View File

@ -38,6 +38,7 @@ module Homebrew
def readall
args = readall_args.parse
Homebrew.with_no_api_env do
if args.syntax? && args.no_named?
scan_files = "#{HOMEBREW_LIBRARY_PATH}/**/*.rb"
ruby_files = Dir.glob(scan_files).grep_v(%r{/(vendor)/})
@ -56,7 +57,7 @@ module Homebrew
raise UsageError, "`brew readall` needs a tap or `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!"
end
Tap
Tap.select(&:installed?)
else
args.named.to_installed_taps
end
@ -66,3 +67,4 @@ module Homebrew
end
end
end
end

View File

@ -1146,9 +1146,9 @@ class CoreTap < AbstractCoreTap
# @private
sig { returns(T::Array[Pathname]) }
def formula_files
return super if Homebrew::EnvConfig.no_install_from_api? || installed?
return super if Homebrew::EnvConfig.no_install_from_api?
raise TapUnavailableError, name
formula_files_by_name.values
end
# @private