diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 8b7ebff471..bd903fff35 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -176,10 +176,11 @@ module Homebrew print "Formula name [#{stem}]: " fc.name = __gets || stem end - raise TapUnavailableError, fc.tap.name unless fc.tap.installed? fc.url = args.named.first + fc.verify + # Check for disallowed formula, or names that shadow aliases, # unless --force is specified. unless args.force? diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 604ac6b686..02d26fa30f 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -9,7 +9,6 @@ module Homebrew # # @api private class FormulaCreator - attr_reader :tap attr_accessor :name sig { @@ -26,6 +25,11 @@ module Homebrew @head = head end + sig { void } + def verify + raise TapUnavailableError, @tap.name unless @tap.installed? + end + def url=(url) @url = url path = Pathname.new(url)