Skip to content
Snippets Groups Projects
Commit 19f9fecb authored by Bo Anderson's avatar Bo Anderson
Browse files

dev-cmd/update-license-data: fail if not changed rather than on change

parent 4765814b
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment