livecheck: fix filtering of watchlist with --formulae/--casks flag

This commit is contained in:
Seeker 2021-01-27 12:50:47 -08:00
parent 0097c2e604
commit 5dbdcbcb6b

View File

@ -89,11 +89,8 @@ module Homebrew
.reject { |line| line.start_with?("#") || line.blank? }
.map(&:strip)
named_args = T.unsafe(CLI::NamedArgs).new(*names)
named_args.to_formulae_and_casks.reject do |formula_or_cask|
(args.formula? && !formula_or_cask.is_a?(Formula)) ||
(args.cask? && !formula_or_cask.is_a?(Cask::Cask))
end
named_args = T.unsafe(CLI::NamedArgs).new(*names, parent: args)
named_args.to_formulae_and_casks(ignore_unavailable: true)
rescue Errno::ENOENT => e
onoe e
end