Raise when formula name is empty

P.S. That still doesn't check if the name is invalid, like "34"
This commit is contained in:
Anatoli Babenia 2023-11-23 18:06:40 +03:00
parent d8f19ff881
commit 4fed4529d3

View File

@ -50,6 +50,7 @@ module Homebrew
end end
def write_formula! def write_formula!
raise "name should not be empty" if @name.to_s == ''
path = @tap.new_formula_path(@name) path = @tap.new_formula_path(@name)
raise "#{path} already exists" if path.exist? raise "#{path} already exists" if path.exist?