jinja2-cli icon indicating copy to clipboard operation
jinja2-cli copied to clipboard

--strict should make {{ environ('does_not_exist') }} fail?

Open gijsdpg opened this issue 3 years ago • 1 comments

Currently, there is no way to force jinja2-cli to stop processing a template when an environment variable is missing. The template is rendered with None as the missing value. It would be awesome if jinja2-cli would fail on the missing variable.

gijsdpg avatar Aug 18 '21 10:08 gijsdpg

You can write:

{{environ('MYVAR') or MYVAR}}

in your template file and the processing will fail if MYVAR is neither defined in the env or from the other way you can pass key/value to jinja2-cli.

TheErk avatar Mar 28 '22 16:03 TheErk