makejson: De-dupe some code

The `freedoom1.wad` and `freedoom2.wad` files are shipped in the same
.zip, so we can just construct the URL once and be done with it.
This commit is contained in:
Simon Howard 2025-06-11 15:34:18 -04:00
parent f6b286f195
commit 7dae0bc532

View file

@ -51,6 +51,7 @@ for filename in iwads:
iwads[filename]["sha3"] = hashlib.sha3_512(data).hexdigest() iwads[filename]["sha3"] = hashlib.sha3_512(data).hexdigest()
iwads[filename]["blake2b"] = hashlib.blake2b(data).hexdigest() iwads[filename]["blake2b"] = hashlib.blake2b(data).hexdigest()
iwads[filename]["version"] = version
iwads["freedoom1.wad"]["url"] = ( iwads["freedoom1.wad"]["url"] = (
"https://github.com/freedoom/freedoom/releases/download/v" "https://github.com/freedoom/freedoom/releases/download/v"
@ -59,15 +60,7 @@ iwads["freedoom1.wad"]["url"] = (
+ version + version
+ ".zip" + ".zip"
) )
iwads["freedoom1.wad"]["version"] = version iwads["freedoom2.wad"]["url"] = iwads["freedoom1.wad"]["url"]
iwads["freedoom2.wad"]["url"] = (
"https://github.com/freedoom/freedoom/releases/download/v"
+ version
+ "/freedoom-"
+ version
+ ".zip"
)
iwads["freedoom2.wad"]["version"] = version
iwads["freedm.wad"]["url"] = ( iwads["freedm.wad"]["url"] = (
"https://github.com/freedoom/freedoom/releases/download/v" "https://github.com/freedoom/freedoom/releases/download/v"
+ version + version
@ -75,7 +68,6 @@ iwads["freedm.wad"]["url"] = (
+ version + version
+ ".zip" + ".zip"
) )
iwads["freedm.wad"]["version"] = version
with open(json_file, "w") as f: with open(json_file, "w") as f:
json.dump(iwads, f, indent=2, sort_keys=True) json.dump(iwads, f, indent=2, sort_keys=True)