aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-12-13 01:53:05 +0000
committerMike McQuaid2016-12-13 01:53:05 +0000
commit8f80cc65686bd6b5eed365fd7d9f822366c01943 (patch)
treea15c908e67e06ef10e009b8e8bb5fdbd99dc22a0 /Library/Homebrew/tap.rb
parent666463ca2be08261cf103e4870b267f5b461a7f3 (diff)
downloadbrew-8f80cc65686bd6b5eed365fd7d9f822366c01943.tar.bz2
diagnostic: check for bad tap files.
Check for Ruby files in taps that are outside of the detected `Formula` directory for a tap but inside one of the other potential directories. This usually indicates a formula has been added in the wrong directory in a tap and is used to fail CI in this case.
Diffstat (limited to 'Library/Homebrew/tap.rb')
-rw-r--r--Library/Homebrew/tap.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 68b21ac60..4b59f2344 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -292,7 +292,11 @@ class Tap
# path to the directory of all {Formula} files for this {Tap}.
def formula_dir
- @formula_dir ||= [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?)
+ @formula_dir ||= potential_formula_dirs.detect(&:directory?)
+ end
+
+ def potential_formula_dirs
+ @potential_formula_dirs ||= [path/"Formula", path/"HomebrewFormula", path].freeze
end
# path to the directory of all {Cask} files for this {Tap}.