tap: tighten formula_file?(file)

Cask is never a formula.
This commit is contained in:
Yukai Chou 2023-04-05 03:25:59 +08:00
parent 97d7a5c9b4
commit b1b94187af

View File

@ -570,7 +570,7 @@ class Tap
file = file.expand_path(path) file = file.expand_path(path)
return false unless ruby_file?(file) return false unless ruby_file?(file)
file.to_s.start_with?("#{formula_dir}/") file.to_s.start_with?("#{formula_dir}/") && !file.to_s.start_with?("#{cask_dir}/")
end end
# return true if given path would present a {Cask} file in this {Tap}. # return true if given path would present a {Cask} file in this {Tap}.