From 4fed4529d3021e2f766135c7f4c432ba68ad5aeb Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Thu, 23 Nov 2023 18:06:40 +0300 Subject: [PATCH] Raise when formula name is empty P.S. That still doesn't check if the name is invalid, like "34" --- Library/Homebrew/formula_creator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 3c7b3933d7b64..14ea817481aa3 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -50,6 +50,7 @@ def head? end def write_formula! + raise "name should not be empty" if @name.to_s == '' path = @tap.new_formula_path(@name) raise "#{path} already exists" if path.exist?