Merge pull request #11509 from issyl0/cask-caveats-in-summary

cask/installer: Add Cask caveats to the end-of-operation summary
This commit is contained in:
Issy Long 2021-06-10 09:43:14 +01:00 committed by GitHub
commit bf7f2e9a49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -56,6 +56,8 @@ module Cask
caveats = cask.caveats
return if caveats.empty?
Homebrew.messages.record_caveats(cask.token, caveats)
<<~EOS
#{ohai_title "Caveats"}
#{caveats}

View File

@ -769,7 +769,7 @@ class FormulaInstaller
@show_summary_heading = true
ohai "Caveats", caveats.to_s
Homebrew.messages.record_caveats(formula, caveats)
Homebrew.messages.record_caveats(formula.name, caveats)
end
sig { void }

View File

@ -15,8 +15,8 @@ class Messages
@install_times = []
end
def record_caveats(f, caveats)
@caveats.push(formula: f.name, caveats: caveats)
def record_caveats(package, caveats)
@caveats.push(package: package, caveats: caveats)
end
def formula_installed(f, elapsed_time)
@ -36,7 +36,7 @@ class Messages
oh1 "Caveats"
@caveats.each do |c|
ohai c[:formula], c[:caveats]
ohai c[:package], c[:caveats]
end
end