Skip to content
Snippets Groups Projects
Commit f345f554 authored by Seeker's avatar Seeker
Browse files

update-license-data: fix latest_tag error

Add latest_tag method to utils/spdx
parent deea71b1
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,6 @@ module Homebrew
ohai "git add"
safe_system "git", "add", SPDX::JSON_PATH
ohai "git commit"
system "git", "commit", "--message", "data/spdx.json: update to #{latest_tag}"
system "git", "commit", "--message", "data/spdx.json: update to #{SPDX.latest_tag}"
end
end
......@@ -12,8 +12,11 @@ module SPDX
@spdx_data ||= JSON.parse(JSON_PATH.read)
end
def latest_tag
@latest_tag ||= GitHub.open_api(API_URL)["tag_name"]
end
def download_latest_license_data!(to: JSON_PATH)
latest_tag = GitHub.open_api(API_URL)["tag_name"]
data_url = "https://raw.githubusercontent.com/spdx/license-list-data/#{latest_tag}/json/licenses.json"
curl_download(data_url, to: to, partial: false)
end
......
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