chevdor/tera-cli

Issue with --env-only

chevdor opened this issue · 3 comments

Using --env and --env-only fails:

tera --env --env-only --template templates/release.md
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/wrapped_context.rs:122:59
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Current workaround:

echo {} | tera --env --template templates/release.md --stdin

That seems to be also an issue with:

tera --template templates/changelog.md /tmp/test.json 

The issue here (the error could be nicer) is that we passed an array instead of an object.

That was no bug actually and the improvement in the error message should help spot the issue.