From 7b07514b9328e50801dac4e09134fb081006c460 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Wed, 26 May 2021 18:39:42 +0200 Subject: [PATCH] Use script-based template finding Instead of calling location based template finding Signed-off-by: Nils VAN ZUIJLEN --- README-generator/make_readme.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README-generator/make_readme.py b/README-generator/make_readme.py index fd40768..5671820 100755 --- a/README-generator/make_readme.py +++ b/README-generator/make_readme.py @@ -3,6 +3,7 @@ import argparse import json import os +from pathlib import Path from jinja2 import Environment, FileSystemLoader @@ -19,7 +20,7 @@ def generate_READMEs(app_path): print("There's no 'upstream' key in the manifest, and doc/DISCLAIMER.md doesn't exists - therefore assuming that we shall not auto-update the README.md for this app yet.") return - env = Environment(loader=FileSystemLoader('./templates')) + env = Environment(loader=FileSystemLoader(Path(__file__).parent / "templates")) for lang, lang_suffix in [("en", ""), ("fr", "_fr")]: @@ -51,4 +52,4 @@ if __name__ == "__main__": help='Path to the app to generate/update READMEs for') args = parser.parse_args() - generate_READMEs(args.app_path) + generate_READMEs(Path(args.app_path))