dev-cmd/cat: improve error message.

Fixes #14815.

Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
This commit is contained in:
Mike McQuaid 2023-02-27 17:34:29 +00:00
parent a7a3ecacba
commit d6ba3878ab
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -44,6 +44,19 @@ module Homebrew
"cat"
end
args.named.to_paths.each do |path|
next path if path.exist?
path = path.basename(".rb") if args.cask?
ofail "#{path}'s source doesn't exist on disk."
end
if Homebrew.failed?
$stderr.puts "The name may be wrong, or the tap hasn't been tapped."
return
end
safe_system pager, *args.named.to_paths
end
end