dev-cmd/update-maintainers: If there are changes, auto-update man pages

- I noticed this in a PR recently, maybe the maintainer didn't think
  they would have to run `brew man` for this? In that case there's an
  extra step after the PR is raised, red CI checks on the PR (which is
  demoralising) and potentially requires a reviewer to point this out.
- This runs `brew man` if the `README` file has a diff as part of this
  command. Then the user has to `git add .` and their PR is (probably)
  good.
This commit is contained in:
Issy Long 2021-02-09 21:08:57 +00:00
parent 59dd425f43
commit dde89d8d2b
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -3,6 +3,7 @@
require "cli/parser"
require "utils/github"
require "dev-cmd/man"
module Homebrew
extend T::Sig
@ -61,7 +62,8 @@ module Homebrew
if diff.status.success?
puts "No changes to list of maintainers."
else
puts "List of maintainers updated in README."
Homebrew.regenerate_man_pages(preserve_date: true, quiet: true)
puts "List of maintainers updated in the README and the generated man pages."
end
end
end