Merge pull request #14 from MLH-Fellowship/license-create
License create
This commit is contained in:
commit
fcc2f4cfd6
@ -45,8 +45,11 @@ module Homebrew
|
|||||||
description: "Explicitly set the <name> of the new formula."
|
description: "Explicitly set the <name> of the new formula."
|
||||||
flag "--set-version=",
|
flag "--set-version=",
|
||||||
description: "Explicitly set the <version> of the new formula."
|
description: "Explicitly set the <version> of the new formula."
|
||||||
|
flag "--set-license=",
|
||||||
|
description: "Explicitly set the <license> of the new formula."
|
||||||
flag "--tap=",
|
flag "--tap=",
|
||||||
description: "Generate the new formula within the given tap, specified as <user>`/`<repo>."
|
description: "Generate the new formula within the given tap, specified as <user>`/`<repo>."
|
||||||
|
|
||||||
switch :force
|
switch :force
|
||||||
switch :verbose
|
switch :verbose
|
||||||
switch :debug
|
switch :debug
|
||||||
@ -66,11 +69,13 @@ module Homebrew
|
|||||||
|
|
||||||
version = args.set_version
|
version = args.set_version
|
||||||
name = args.set_name
|
name = args.set_name
|
||||||
|
license = args.set_license
|
||||||
tap = args.tap
|
tap = args.tap
|
||||||
|
|
||||||
fc = FormulaCreator.new
|
fc = FormulaCreator.new
|
||||||
fc.name = name
|
fc.name = name
|
||||||
fc.version = version
|
fc.version = version
|
||||||
|
fc.license = license
|
||||||
fc.tap = Tap.fetch(tap || "homebrew/core")
|
fc.tap = Tap.fetch(tap || "homebrew/core")
|
||||||
raise TapUnavailableError, tap unless fc.tap.installed?
|
raise TapUnavailableError, tap unless fc.tap.installed?
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ require "erb"
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
class FormulaCreator
|
class FormulaCreator
|
||||||
attr_reader :url, :sha256, :desc, :homepage
|
attr_reader :url, :sha256, :desc, :homepage
|
||||||
attr_accessor :name, :version, :tap, :path, :mode
|
attr_accessor :name, :version, :tap, :path, :mode, :license
|
||||||
|
|
||||||
def url=(url)
|
def url=(url)
|
||||||
@url = url
|
@url = url
|
||||||
@ -100,6 +100,7 @@ module Homebrew
|
|||||||
<% end %>
|
<% end %>
|
||||||
sha256 "#{sha256}"
|
sha256 "#{sha256}"
|
||||||
<% end %>
|
<% end %>
|
||||||
|
license "#{license}"
|
||||||
|
|
||||||
<% if mode == :cmake %>
|
<% if mode == :cmake %>
|
||||||
depends_on "cmake" => :build
|
depends_on "cmake" => :build
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user