HOMEBREW_UPDATE_REPORT_ALL_FORMULA displays new formulae and casks

Only show new formulae or casks when HOMEBREW_UPDATE_REPORT_ALL_FORMULAE
environment variable is set.

Stop checking for HOMEBREW_UPDATE_REPORT_ALL_FORMULAE when the key is
:R, :A or :AC in ReporterHub#dump_formula_or_cask_report because
that check is made redundant by the check in ReporterHub#dump.
This commit is contained in:
apainintheneck 2022-06-09 10:18:53 -07:00
parent 4484068dee
commit e0a6743580

View File

@ -542,7 +542,7 @@ class ReporterHub
def dump(updated_formula_report: true)
# Key Legend: Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R)
unless Homebrew::EnvConfig.update_report_all_formulae?
if Homebrew::EnvConfig.update_report_all_formulae?
dump_formula_or_cask_report :A, "New Formulae"
dump_formula_or_cask_report :AC, "New Casks"
dump_formula_or_cask_report :R, "Renamed Formulae"
@ -617,15 +617,13 @@ class ReporterHub
# Format list items of formulae
case key
when :R
if report_all
name = pretty_installed(name) if installed?(name)
new_name = pretty_installed(new_name) if installed?(new_name)
"#{name} -> #{new_name}"
end
when :A
name if report_all && !installed?(name)
name unless installed?(name)
when :AC
name.split("/").last if report_all && !cask_installed?(name)
name.split("/").last unless cask_installed?(name)
when :MC
name = name.split("/").last
if cask_installed?(name)