diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 4cbff785d8..3815de0604 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -68,7 +68,6 @@ module Homebrew "--perl", "--python", "--ruby", "--rust", "--cask" conflicts "--cask", "--HEAD" conflicts "--cask", "--set-license" - conflicts "--cask", "--tap" named 1 end @@ -94,7 +93,11 @@ module Homebrew raise UsageError, "The `--set-name` flag is required for creating casks." end - cask_path = Cask::CaskLoader.path(token) + cask_tap = Tap.fetch(args.tap || "homebrew/cask") + raise TapUnavailableError, args.tap unless cask_tap.installed? + + cask_path = Cask::CaskLoader.path("#{cask_tap}/#{token}") + cask_path.dirname.mkpath unless cask_path.dirname.exist? raise Cask::CaskAlreadyCreatedError, token if cask_path.exist? version = if args.set_version @@ -142,7 +145,7 @@ module Homebrew fc.version = args.set_version fc.license = args.set_license fc.tap = Tap.fetch(args.tap || "homebrew/core") - raise TapUnavailableError, tap unless fc.tap.installed? + raise TapUnavailableError, args.tap unless fc.tap.installed? fc.url = args.named.first # Pull the first (and only) url from ARGV