Add comment about auto-generated file [ci skip]

This commit is contained in:
Ines Montani 2020-08-13 23:27:25 +02:00
parent 88b0a96801
commit 8736bfc052
2 changed files with 5 additions and 4 deletions

View File

@ -1195,13 +1195,13 @@ def main(
# fmt: on
):
"""Convert a jinja2 template to a JavaScript module."""
compiler = JinjaToJS(
template_path.parent, template_path.parts[-1], js_module_format="es6"
)
tpl_file = template_path.parts[-1]
compiler = JinjaToJS(template_path.parent, tpl_file, js_module_format="es6")
header = f"// This file was auto-generated by {__file__} based on {tpl_file}"
result = compiler.get_output()
if output is not None:
with output.open("w") as f:
f.write(result)
f.write(f"{header}\n{result}")
print(f"Updated {output.parts[-1]}")
else:
print(result)

View File

@ -1,3 +1,4 @@
// This file was auto-generated by jinja_to_js.py based on quickstart_training.jinja
import jinjaToJS from "jinja-to-js";export default function templateQuickstartTraining(ctx) {
var __result = "";
var __tmp;