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:
@@ -5,13 +5,14 @@
|
|||||||
import functools
|
import functools
|
||||||
import json
|
import json
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import sys
|
||||||
|
|
||||||
import git
|
import git
|
||||||
import requests
|
import requests
|
||||||
import yaml
|
import yaml
|
||||||
from jinja2 import Environment, FileSystemLoader, StrictUndefined, Template
|
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
|
assert REPO.working_dir is not None
|
||||||
|
|
||||||
ROOT = pathlib.Path(REPO.working_dir)
|
ROOT = pathlib.Path(REPO.working_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user