From 18b5137083938a57828b34c8b8532268b9cde5ce Mon Sep 17 00:00:00 2001 From: anulax Date: Thu, 20 Feb 2025 21:29:50 +0100 Subject: [PATCH] Update src/Package.py --- src/Package.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Package.py b/src/Package.py index 7522c87..4e9b551 100644 --- a/src/Package.py +++ b/src/Package.py @@ -61,7 +61,7 @@ def reconfig(): f_linker.write(includes + links) f_linker.close() -def install(author, package) -> None: +def install(author, package, repo) -> None: Log.info(f"Installing package {package}") if os.path.exists(f"./vendor/{package}"): Log.warning(f"Package {package} already added") @@ -70,19 +70,19 @@ def install(author, package) -> None: conf = json.loads(conf) if len(conf["packages"]) > 0: for pkg in conf["packages"]: - install(pkg["author"], pkg["name"]) + install(pkg["author"], pkg["name"], pkg["repo"] if "repo" in pkg else "git.anulax.ch") return if not ToolChaine.tool_exist("git"): Log.error("Tool missing git") - Command.exec(f"git clone --depth 5 https://github.com/{author}/{package} ./vendor/{package}") + Command.exec(f"git clone --depth 5 https://{repo}/{author}/{package} ./vendor/{package}") if os.path.exists(f"./vendor/{package}/package.json"): conf = open(f"./vendor/{package}/package.json", "r").read() conf = json.loads(conf) if len(conf["packages"]) > 0: for pkg in conf["packages"]: - install(pkg["author"], pkg["name"]) + install(pkg["author"], pkg["name"], pkg["repo"] if "repo" in pkg else "git.anulax.ch") def add(author, package) -> None: f_conf = open("./package.json", "r") @@ -149,7 +149,7 @@ def install_root() -> None: conf = json.loads(f_conf.read()) f_conf.close() for pkg in conf["packages"]: - install(pkg["author"], pkg["name"]) + install(pkg["author"], pkg["name"], pkg["repo"] if "repo" in pkg else "git.anulax.ch") reconfig() def load_doc(package) -> None: @@ -158,4 +158,4 @@ def load_doc(package) -> None: if not os.path.exists(f"./vendor/{package}/Doxyfile"): Log.error("Doxygen config file not found") Command.exec(f"doxygen ./vendor/{package}") - webbrowser.open("file://" + os.path.realpath(f"./vendor/{package}/docs/html/index.html")) \ No newline at end of file + webbrowser.open("file://" + os.path.realpath(f"./vendor/{package}/docs/html/index.html"))