aboutsummaryrefslogtreecommitdiff
path: root/publish/update_updatejson.py
diff options
context:
space:
mode:
Diffstat (limited to 'publish/update_updatejson.py')
-rw-r--r--publish/update_updatejson.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/publish/update_updatejson.py b/publish/update_updatejson.py
new file mode 100644
index 0000000..8d751e5
--- /dev/null
+++ b/publish/update_updatejson.py
@@ -0,0 +1,25 @@
+import json
+import subprocess
+
+jsonPath = "../updatejson/update.json"
+
+# lol
+fullFormat = "updateJsonFullVersionFormat=true" in open("gradle.properties", "r", encoding="utf8").read()
+
+data = json.load(open(jsonPath, "r", encoding="utf8"))
+ver = open("version.txt", "r").read().strip()
+
+for gameVer in json.load(open("gameVersions.json", "r")).keys():
+ modVer = "{}".format(ver) if not fullFormat else "{}-{}".format(gameVer, ver)
+
+ if gameVer not in data:
+ data[gameVer] = {}
+
+ data[gameVer][modVer] = ""
+ data["promos"]["{}-latest".format(gameVer)] = modVer
+
+json.dump(data, open(jsonPath, "w", encoding="utf8"), indent=2)
+
+subprocess.run(["git", "add", jsonPath])
+subprocess.run(["git", "commit", "-m", "[skip ci] Update update json"])
+subprocess.run(["git", "push"]) \ No newline at end of file