CI: support delete plugin

This commit is contained in:
xtaodada 2022-07-26 14:11:31 +08:00
parent b9683c2d9f
commit 4991fda439
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -10,6 +10,7 @@ for file in main["files"]:
exit()
if "/main.py" in file["filename"]:
plugins.append(file["filename"].split("/")[0])
delete = bool(main['commit']['message'].startswith("Delete:"))
with open("list.json", "r", encoding="utf8") as f:
list_json = json.load(f)
@ -20,6 +21,8 @@ for plugin in plugins:
exist = True
old_version = float(plug_dict["version"])
list_json["list"][list_json["list"].index(plug_dict)]["version"] = str(old_version + 0.01)
if delete:
list_json["list"].remove(plug_dict)
break
if not exist:
list_json["list"].append(