mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Pass args
to create
instead of using global args
.
This commit is contained in:
parent
6b0b25cd00
commit
e669949659
@ -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
|
||||
|
@ -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!
|
||||
|
Loading…
x
Reference in New Issue
Block a user