Save tap in constructor

This commit is contained in:
Anatoli Babenia 2023-11-28 16:07:38 +00:00
parent d1820a8fb1
commit 912678ca5e
2 changed files with 3 additions and 2 deletions

View File

@ -143,6 +143,7 @@ module Homebrew
fc = FormulaCreator.new(
args.set_name,
args.set_version,
tap: args.tap,
license: args.set_license,
fetch: !args.no_fetch?,
head: args.HEAD?,
@ -152,7 +153,6 @@ module Homebrew
print "Formula name [#{stem}]: "
fc.name = __gets || stem
end
fc.tap = Tap.fetch(args.tap || "homebrew/core")
raise TapUnavailableError, fc.tap.name unless fc.tap.installed?
fc.url = args.named.first

View File

@ -12,9 +12,10 @@ module Homebrew
attr_reader :url, :sha256, :desc, :homepage
attr_accessor :name, :tap, :mode
def initialize(name, version, license:, fetch: true, head: false)
def initialize(name, version, tap:, license:, fetch: true, head: false)
@name = name
@version = Version.new(version) if version
@tap = Tap.fetch(tap || "homebrew/core")
@license = license
@fetch = fetch
@head = head