cmd/tap: don't stacktrace on user error

Resolves #19427.
This commit is contained in:
Adrian Ho 2025-03-05 17:31:25 +08:00
parent 5abfab9835
commit 7fe2f3b045

View File

@ -59,14 +59,14 @@ module Homebrew
elsif args.no_named? elsif args.no_named?
puts Tap.installed.sort_by(&:name) puts Tap.installed.sort_by(&:name)
else else
tap = Tap.fetch(args.named.fetch(0))
begin begin
tap = Tap.fetch(args.named.fetch(0))
tap.install clone_target: args.named.second, tap.install clone_target: args.named.second,
custom_remote: args.custom_remote?, custom_remote: args.custom_remote?,
quiet: args.quiet?, quiet: args.quiet?,
verify: args.eval_all? || Homebrew::EnvConfig.eval_all?, verify: args.eval_all? || Homebrew::EnvConfig.eval_all?,
force: args.force? force: args.force?
rescue TapRemoteMismatchError, TapNoCustomRemoteError => e rescue Tap::InvalidNameError, TapRemoteMismatchError, TapNoCustomRemoteError => e
odie e odie e
rescue TapAlreadyTappedError rescue TapAlreadyTappedError
nil nil