From ca3fe811de7582b839da43ef56762f5307f6c4b2 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Sat, 22 Jul 2023 12:46:45 -0400 Subject: [PATCH] formula_creator: require version before creating --- Library/Homebrew/formula_creator.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index ad93b8185d..dd4a3701ef 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -60,8 +60,7 @@ module Homebrew raise "#{path} already exists" if path.exist? if version.nil? || version.null? - opoo "Version cannot be determined from URL." - puts "You'll need to add an explicit 'version' to the formula." + odie "Version cannot be determined from URL. Explicity set the version with `--set-version` instead." elsif fetch? unless head? r = Resource.new @@ -108,7 +107,7 @@ module Homebrew homepage "#{homepage}" <% unless head? %> url "#{url}" - <% unless version.nil? or version.detected_from_url? %> + <% unless version.detected_from_url? %> version "#{version}" <% end %> sha256 "#{sha256}"