formula_creator: Remove tap accessor

This commit is contained in:
Anatoli Babenia 2023-11-29 18:57:24 +00:00
parent 2d9db76d61
commit a7756bd303
2 changed files with 7 additions and 2 deletions

View File

@ -176,10 +176,11 @@ module Homebrew
print "Formula name [#{stem}]: " print "Formula name [#{stem}]: "
fc.name = __gets || stem fc.name = __gets || stem
end end
raise TapUnavailableError, fc.tap.name unless fc.tap.installed?
fc.url = args.named.first fc.url = args.named.first
fc.verify
# Check for disallowed formula, or names that shadow aliases, # Check for disallowed formula, or names that shadow aliases,
# unless --force is specified. # unless --force is specified.
unless args.force? unless args.force?

View File

@ -9,7 +9,6 @@ module Homebrew
# #
# @api private # @api private
class FormulaCreator class FormulaCreator
attr_reader :tap
attr_accessor :name attr_accessor :name
sig { sig {
@ -26,6 +25,11 @@ module Homebrew
@head = head @head = head
end end
sig { void }
def verify
raise TapUnavailableError, @tap.name unless @tap.installed?
end
def url=(url) def url=(url)
@url = url @url = url
path = Pathname.new(url) path = Pathname.new(url)