Skip to content

Commit 10eb549

Browse files
committed
cmd/info: don't print empty caveats.
The existing logic was insufficient so let's check the actual string.
1 parent d90a421 commit 10eb549

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Library/Homebrew/cmd/info.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ def info_formula(formula)
360360
end
361361

362362
caveats = Caveats.new(formula)
363-
ohai "Caveats", caveats.to_s unless caveats.empty?
363+
if (caveats_string = caveats.to_s.presence)
364+
ohai "Caveats", caveats_string
365+
end
364366

365367
Utils::Analytics.formula_output(formula, args:)
366368
end

0 commit comments

Comments
 (0)