Merge pull request #15648 from Bo98/tap-fix

tap: fix handling of taps without formulae
This commit is contained in:
Bo Anderson 2023-07-07 21:18:58 +01:00 committed by GitHub
commit 6b128579d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -508,7 +508,13 @@ class Tap
sig { returns(T::Array[Pathname]) } sig { returns(T::Array[Pathname]) }
def formula_files def formula_files
@formula_files ||= if formula_dir.directory? @formula_files ||= if formula_dir.directory?
formula_dir.find.select(&method(:formula_file?)) if formula_dir == path
# We only want the top level here so we don't treat commands & casks as formulae.
# Sharding is only supported in Formula/ and HomebrewFormula/.
formula_dir.children
else
formula_dir.find
end.select(&method(:formula_file?))
else else
[] []
end end