Remove license accessor

This commit is contained in:
Anatoli Babenia 2023-11-28 15:46:01 +00:00
parent 2151c59de2
commit c17fc7b6f6
2 changed files with 5 additions and 5 deletions

View File

@ -140,13 +140,12 @@ module Homebrew
end
def create_formula(args:)
fc = FormulaCreator.new(args.set_name, args.set_version, fetch: !args.no_fetch?, head: args.HEAD?)
fc = FormulaCreator.new(args.set_name, args.set_version, license: args.set_license, fetch: !args.no_fetch?, head: args.HEAD?)
if fc.name.blank?
stem = Pathname.new(args.named.first).stem.rpartition("=").last
print "Formula name [#{stem}]: "
fc.name = __gets || stem
end
fc.license = args.set_license
fc.tap = Tap.fetch(args.tap || "homebrew/core")
raise TapUnavailableError, fc.tap.name unless fc.tap.installed?

View File

@ -10,11 +10,12 @@ module Homebrew
# @api private
class FormulaCreator
attr_reader :url, :sha256, :desc, :homepage
attr_accessor :name, :tap, :mode, :license
attr_accessor :name, :tap, :mode
def initialize(name, version, fetch: true, head: false)
def initialize(name, version, license:, fetch: true, head: false)
@name = name
@version = Version.new(version) if version
@license = license
@fetch = fetch
@head = head
end
@ -101,7 +102,7 @@ module Homebrew
<% end %>
sha256 "#{sha256}"
<% end %>
license "#{license}"
license "#{@license}"
<% if @head %>
head "#{url}"
<% end %>