From 6bda98fd9d11d85e9de1912a2dbbbaa293efc57a Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Sat, 27 Jul 2024 14:52:33 +0200 Subject: [PATCH] test --- .forgejo/scripts/update-wiki.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.forgejo/scripts/update-wiki.py b/.forgejo/scripts/update-wiki.py index 03006ea..f168844 100644 --- a/.forgejo/scripts/update-wiki.py +++ b/.forgejo/scripts/update-wiki.py @@ -4,16 +4,30 @@ from pip._vendor import tomli import glob import os +def noop(): + return + mods = dict() for mod in glob.glob("pack/mods/*.toml"): with open(mod, "r") as f: data = tomli.load(f) url = "" - if "modrinth" in data.update: + + # there has to be a better way to do this + + try: + print("MR: " + data.update.modrinth["mod-id"] url = "https://modrinth.com/mod/" + data.update.modrinth["mod-id"] - elif "curseforge" in data.update: - url = "https://legacy.curseforge.com/mod/" + data.update.modrinth["mod-id"] + catch: + noop() + + try: + print("CF: " + data.update.curseforge["mod-id"] + url = "http://dev.bukkit.org/bukkit-plugins/" + data.update.curseforge["mod-id"] + catch: + noop() + mods[data.name] = url with open("wiki/Modlist.md", "w") as f: