Improve brew man output.

This commit is contained in:
Markus Reiter 2020-09-26 02:24:16 +02:00
parent f54b458cda
commit d443afc82d
2 changed files with 7 additions and 2 deletions

View File

@ -21,7 +21,7 @@ module Homebrew
end end
def to_formulae def to_formulae
@to_formulae ||= to_formulae_and_casks.select { |o| o.is_a?(Formula) }.freeze @to_formulae ||= to_formulae_and_casks(only: :formula).freeze
end end
def to_formulae_and_casks(only: nil) def to_formulae_and_casks(only: nil)

View File

@ -38,9 +38,14 @@ module Homebrew
Commands.rebuild_internal_commands_completion_list Commands.rebuild_internal_commands_completion_list
regenerate_man_pages(preserve_date: args.fail_if_changed?, quiet: args.quiet?) regenerate_man_pages(preserve_date: args.fail_if_changed?, quiet: args.quiet?)
if system "git", "-C", HOMEBREW_REPOSITORY, "diff", "--quiet", "docs/Manpage.md", "manpages", "completions" diff = system_command "git", args: [
"-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "docs/Manpage.md", "manpages", "completions"
]
if diff.status.success?
puts "No changes to manpage or completions output detected." puts "No changes to manpage or completions output detected."
elsif args.fail_if_changed? elsif args.fail_if_changed?
puts "Changes to manpage or completions detected:"
puts diff.stdout
Homebrew.failed = true Homebrew.failed = true
end end
end end