Pass args to create instead of using global args.

This commit is contained in:
Markus Reiter 2020-07-23 03:08:19 +02:00
parent 6b0b25cd00
commit e669949659
2 changed files with 9 additions and 5 deletions

View File

@ -63,7 +63,7 @@ module Homebrew
# Create a formula from a tarball URL
def create
create_args.parse
args = create_args.parse
# Ensure that the cache exists so we can fetch the tarball
HOMEBREW_CACHE.mkpath
@ -75,7 +75,7 @@ module Homebrew
license = args.set_license
tap = args.tap
fc = FormulaCreator.new
fc = FormulaCreator.new(args)
fc.name = name
fc.version = version
fc.license = license

View File

@ -5,9 +5,13 @@ require "erb"
module Homebrew
class FormulaCreator
attr_reader :url, :sha256, :desc, :homepage
attr_reader :args, :url, :sha256, :desc, :homepage
attr_accessor :name, :version, :tap, :path, :mode, :license
def initialize(args)
@args = args
end
def url=(url)
@url = url
path = Pathname.new(url)
@ -41,11 +45,11 @@ module Homebrew
end
def fetch?
!Homebrew.args.no_fetch?
!args.no_fetch?
end
def head?
@head || Homebrew.args.HEAD?
@head || args.HEAD?
end
def generate!