mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
dev-cmd/update-license-data: fail if not changed rather than on change
This commit is contained in:
parent
4765814b1d
commit
19f9fecb33
@ -16,8 +16,8 @@ module Homebrew
|
||||
|
||||
Update SPDX license data in the Homebrew repository.
|
||||
EOS
|
||||
switch "--fail-if-changed",
|
||||
description: "Return a failing status code if current license data's version is different from " \
|
||||
switch "--fail-if-not-changed",
|
||||
description: "Return a failing status code if current license data's version is the same as " \
|
||||
"the upstream. This can be used to notify CI when the SPDX license data is out of date."
|
||||
switch "--commit",
|
||||
description: "Commit changes to the SPDX license data."
|
||||
@ -33,7 +33,7 @@ module Homebrew
|
||||
data_url = "https://raw.githubusercontent.com/spdx/license-list-data/#{latest_tag}/json/licenses.json"
|
||||
curl_download(data_url, to: SPDX_PATH, partial: false)
|
||||
|
||||
Homebrew.failed = !system("git", "diff", "--stat", "--exit-code", SPDX_PATH) if args.fail_if_changed?
|
||||
Homebrew.failed = system("git", "diff", "--stat", "--exit-code", SPDX_PATH) if args.fail_if_not_changed?
|
||||
|
||||
return unless args.commit?
|
||||
|
||||
|
@ -1052,8 +1052,8 @@ directory.
|
||||
|
||||
Update SPDX license data in the Homebrew repository.
|
||||
|
||||
* `--fail-if-changed`:
|
||||
Return a failing status code if current license data's version is different from the upstream. This can be used to notify CI when the SPDX license data is out of date.
|
||||
* `--fail-if-not-changed`:
|
||||
Return a failing status code if current license data's version is the same as the upstream. This can be used to notify CI when the SPDX license data is out of date.
|
||||
* `--commit`:
|
||||
Commit changes to the SPDX license data.
|
||||
|
||||
|
@ -1361,8 +1361,8 @@ Initialise a Git repository in the unpacked source\. This is useful for creating
|
||||
Update SPDX license data in the Homebrew repository\.
|
||||
.
|
||||
.TP
|
||||
\fB\-\-fail\-if\-changed\fR
|
||||
Return a failing status code if current license data\'s version is different from the upstream\. This can be used to notify CI when the SPDX license data is out of date\.
|
||||
\fB\-\-fail\-if\-not\-changed\fR
|
||||
Return a failing status code if current license data\'s version is the same as the upstream\. This can be used to notify CI when the SPDX license data is out of date\.
|
||||
.
|
||||
.TP
|
||||
\fB\-\-commit\fR
|
||||
|
Loading…
x
Reference in New Issue
Block a user