Support update of modder info

This commit is contained in:
brostosjoined 2025-06-04 16:44:13 +03:00
parent 0da3ebca0b
commit 35012b68b5
2 changed files with 7 additions and 3 deletions

View file

@ -11,12 +11,17 @@ def update_plugin_json(plugin_info, category):
data = json.load(file)
try:
# Check if plugin is already in the json
data['plugins'][name]
plugin = data['plugins'][name]
plugman_version = int(next(iter(data["plugins"][name]["versions"])).replace('.', ''))
current_version = int(next(iter(details["versions"])).replace('.', ''))
# `or` In case another change was made on the plugin while still on pr
if current_version > plugman_version or current_version == plugman_version:
data[name][details]["versions"][next(iter(details["versions"]))] = None
plugin["versions"][next(iter(details["versions"]))] = None
# Ensure latest version appears first
plugin["versions"] = dict(sorted(plugin["versions"].items(), reverse=True))
plugin["description"] = details["description"]
plugin["external_url"] = details["external_url"]
plugin["authors"] = details["authors"]
elif current_version < plugman_version:
raise Exception('Version cant be lower than the previous')
except KeyError:

View file

@ -221,7 +221,6 @@ def auto_apply_version_metadata(last_commit_sha):
if __name__ == "__main__":
try:
last_commit_sha = sys.argv[1]
print(type(sys.argv), sys.argv)
except KeyError:
raise ValueError("Last commit SHA not provided.")
else: