Remove license accessor
This commit is contained in:
parent
2151c59de2
commit
c17fc7b6f6
@ -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?
|
||||
|
||||
|
||||
@ -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 %>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user