diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 3fe90865c6..fd519ba0d3 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -45,8 +45,11 @@ module Homebrew description: "Explicitly set the of the new formula." flag "--set-version=", description: "Explicitly set the of the new formula." + flag "--set-license=", + description: "Explicitly set the of the new formula." flag "--tap=", description: "Generate the new formula within the given tap, specified as `/`." + switch :force switch :verbose switch :debug @@ -66,11 +69,13 @@ module Homebrew version = args.set_version name = args.set_name + license = args.set_license tap = args.tap fc = FormulaCreator.new fc.name = name fc.version = version + fc.license = license fc.tap = Tap.fetch(tap || "homebrew/core") raise TapUnavailableError, tap unless fc.tap.installed? diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index caa1d81891..c040d8f1bd 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -6,7 +6,7 @@ require "erb" module Homebrew class FormulaCreator attr_reader :url, :sha256, :desc, :homepage - attr_accessor :name, :version, :tap, :path, :mode + attr_accessor :name, :version, :tap, :path, :mode, :license def url=(url) @url = url @@ -100,6 +100,7 @@ module Homebrew <% end %> sha256 "#{sha256}" <% end %> + license "#{license}" <% if mode == :cmake %> depends_on "cmake" => :build