cmd/info: don't print empty caveats.

The existing logic was insufficient so let's check the actual string.
This commit is contained in:
Mike McQuaid 2025-07-29 15:18:24 +01:00
parent d90a421467
commit 10eb5491dc
No known key found for this signature in database

View File

@ -360,7 +360,9 @@ module Homebrew
end end
caveats = Caveats.new(formula) 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:) Utils::Analytics.formula_output(formula, args:)
end end