From 7dae0bc53276f0701a05b9c29b4a24d7a17156d2 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 11 Jun 2025 15:34:18 -0400 Subject: [PATCH] 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. --- scripts/makejson | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/makejson b/scripts/makejson index 0179bc99..755720f8 100755 --- a/scripts/makejson +++ b/scripts/makejson @@ -51,6 +51,7 @@ for filename in iwads: iwads[filename]["sha3"] = hashlib.sha3_512(data).hexdigest() iwads[filename]["blake2b"] = hashlib.blake2b(data).hexdigest() + iwads[filename]["version"] = version iwads["freedoom1.wad"]["url"] = ( "https://github.com/freedoom/freedoom/releases/download/v" @@ -59,15 +60,7 @@ iwads["freedoom1.wad"]["url"] = ( + version + ".zip" ) -iwads["freedoom1.wad"]["version"] = version -iwads["freedoom2.wad"]["url"] = ( - "https://github.com/freedoom/freedoom/releases/download/v" - + version - + "/freedoom-" - + version - + ".zip" -) -iwads["freedoom2.wad"]["version"] = version +iwads["freedoom2.wad"]["url"] = iwads["freedoom1.wad"]["url"] iwads["freedm.wad"]["url"] = ( "https://github.com/freedoom/freedoom/releases/download/v" + version @@ -75,7 +68,6 @@ iwads["freedm.wad"]["url"] = ( + version + ".zip" ) -iwads["freedm.wad"]["version"] = version with open(json_file, "w") as f: json.dump(iwads, f, indent=2, sort_keys=True)