Merge pull request #20330 from Homebrew/empty_caveats

cmd/info: don't print empty caveats.
This commit is contained in:
Mike McQuaid 2025-07-30 06:45:05 +00:00 committed by GitHub
commit cb1fe9ac0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,7 +360,9 @@ module Homebrew
end
caveats = Caveats.new(formula)
ohai "Caveats", caveats.to_s unless caveats.empty?
if (caveats_string = caveats.to_s.presence)
ohai "Caveats", caveats_string
end
Utils::Analytics.formula_output(formula, args:)
end