tap: fix handling of taps without formulae

This commit is contained in:
Bo Anderson 2023-07-07 20:58:22 +01:00
parent cf180bbc96
commit 0a9e69ffdf
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -508,7 +508,13 @@ class Tap
sig { returns(T::Array[Pathname]) }
def formula_files
@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
[]
end