Merge pull request #15732 from EricFromCanada/create-require-version
formula_creator: require version before creating
This commit is contained in:
commit
fe7aa4b614
@ -60,8 +60,7 @@ module Homebrew
|
|||||||
raise "#{path} already exists" if path.exist?
|
raise "#{path} already exists" if path.exist?
|
||||||
|
|
||||||
if version.nil? || version.null?
|
if version.nil? || version.null?
|
||||||
opoo "Version cannot be determined from URL."
|
odie "Version cannot be determined from URL. Explicity set the version with `--set-version` instead."
|
||||||
puts "You'll need to add an explicit 'version' to the formula."
|
|
||||||
elsif fetch?
|
elsif fetch?
|
||||||
unless head?
|
unless head?
|
||||||
r = Resource.new
|
r = Resource.new
|
||||||
@ -108,7 +107,7 @@ module Homebrew
|
|||||||
homepage "#{homepage}"
|
homepage "#{homepage}"
|
||||||
<% unless head? %>
|
<% unless head? %>
|
||||||
url "#{url}"
|
url "#{url}"
|
||||||
<% unless version.nil? or version.detected_from_url? %>
|
<% unless version.detected_from_url? %>
|
||||||
version "#{version}"
|
version "#{version}"
|
||||||
<% end %>
|
<% end %>
|
||||||
sha256 "#{sha256}"
|
sha256 "#{sha256}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user