mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Support update of modder info
This commit is contained in:
parent
0da3ebca0b
commit
35012b68b5
2 changed files with 7 additions and 3 deletions
|
|
@ -11,12 +11,17 @@ def update_plugin_json(plugin_info, category):
|
||||||
data = json.load(file)
|
data = json.load(file)
|
||||||
try:
|
try:
|
||||||
# Check if plugin is already in the json
|
# 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('.', ''))
|
plugman_version = int(next(iter(data["plugins"][name]["versions"])).replace('.', ''))
|
||||||
current_version = int(next(iter(details["versions"])).replace('.', ''))
|
current_version = int(next(iter(details["versions"])).replace('.', ''))
|
||||||
# `or` In case another change was made on the plugin while still on pr
|
# `or` In case another change was made on the plugin while still on pr
|
||||||
if current_version > plugman_version or current_version == plugman_version:
|
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:
|
elif current_version < plugman_version:
|
||||||
raise Exception('Version cant be lower than the previous')
|
raise Exception('Version cant be lower than the previous')
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,6 @@ def auto_apply_version_metadata(last_commit_sha):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
last_commit_sha = sys.argv[1]
|
last_commit_sha = sys.argv[1]
|
||||||
print(type(sys.argv), sys.argv)
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise ValueError("Last commit SHA not provided.")
|
raise ValueError("Last commit SHA not provided.")
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue