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 453d952b8f
commit 81e861ef14

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)