Crates.io | tera-cli |
lib.rs | tera-cli |
version | 0.5.0 |
source | src |
created_at | 2019-04-11 15:48:44.788024 |
updated_at | 2023-01-10 04:10:44.241581 |
description | Tera CLI for one-off template interpolation from context file / env vars |
homepage | |
repository | |
max_upload_size | |
id | 127320 |
size | 63,095 |
Tera CLI for one-off template interpolation from context file / env vars.
The following context formats are supported:
--json .
defaults to .tera.json
)--toml .
defaults to .tera.toml
)--yaml .
defaults to .tera.yaml
)See CHANGELOG.md.
Template template.tmpl
{% if hello %}{{ msg }}{% endif %}
TOML .tera.toml
hello = true
msg = "Hello World!"
STDOUT
> tera -f template.tmpl --toml .
Hello World!
> cat template.tmpl | tera --toml .
Hello World!
> tera -s "$(cat template.tmpl)" --toml .
Hello World!
Template template.tmpl
{% if MSG %}{{ MSG }}{% endif %}
STDOUT
> MSG="Hello World!" tera -f template.tmpl --env
Hello World!
By default, setting --toml .
looks for .tera.toml
context file in current
working directory. Similarly, setting --json .
looks for .tera.json
in
current working directory. Use --toml file_to_toml
to change the path to the
context file.
For more details, run
tera --help
Thanks to original Tera author, whose GitHub repository is at: https://github.com/Keats/tera.
Also thanks to BurntSushi
and his ripgrep
repository showcase of GitHub
Actions for cross-compilation, which has been copied and adapted heavily into
this repository. The original files are here:
https://github.com/BurntSushi/ripgrep/tree/8905d54a9f25f4c1e4e3ca8331f517473e174d87/.github/workflows.