From 81e861ef1441f9a1226e4e0a7c74caf54506bf62 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sun, 9 Nov 2025 03:01:08 +0100 Subject: [PATCH] Find root of repo that contains the actual script This makes it possible to run the render script from anywhere and have it still function correctly. --- tools/render | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/render b/tools/render index b761ceb..ee1d392 100755 --- a/tools/render +++ b/tools/render @@ -5,13 +5,14 @@ import functools import json import pathlib +import sys import git import requests import yaml from jinja2 import Environment, FileSystemLoader, StrictUndefined, Template -REPO = git.Repo(".", search_parent_directories=True) +REPO = git.Repo(sys.path[0], search_parent_directories=True) assert REPO.working_dir is not None ROOT = pathlib.Path(REPO.working_dir)