From 0a9e69ffdfc4566e8a05df34b37c3807ab137fb5 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 7 Jul 2023 20:58:22 +0100 Subject: [PATCH] tap: fix handling of taps without formulae --- Library/Homebrew/tap.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 9b5a14d7e7..6988916b33 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -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