mirror of
https://github.com/LegacyModdingMC/UniMixins.git
synced 2026-11-12 16:37:51 +00:00
26 lines
850 B
Python
26 lines
850 B
Python
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 = subprocess.run(["python3", "get_version.py"], capture_output=True, text=True).stdout.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"])
|