generate-man-completions: also fail if only date changed

This commit is contained in:
Eric Knibbe 2024-12-02 15:36:00 -05:00
parent 13c3def049
commit 79fb75177f
No known key found for this signature in database
GPG Key ID: 179D9CDDDB814168

View File

@ -28,10 +28,13 @@ module Homebrew
Completions.update_shell_completions!
diff = system_command "git", args: [
"-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", "docs/Manpage.md", "manpages", "completions"
"-C", HOMEBREW_REPOSITORY,
"diff", "--shortstat", "--patch", "--exit-code", "docs/Manpage.md", "manpages", "completions"
]
if diff.status.success?
ofail "No changes to manpage or completions."
elsif /1 file changed, 1 insertion\(\+\), 1 deletion\(-\).*-\.TH "BREW" "1" "\w+ \d+"/m.match?(diff.stdout)
ofail "No changes to manpage or completions other than the date."
else
puts "Manpage and completions updated."
end