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.
This commit is contained in:
2025-11-09 03:01:08 +01:00
parent 0049b5cb46
commit d2a1eca146

View File

@@ -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)