fix: print module context as json
This commit is contained in:
parent
9564ca0af3
commit
c6f2e5b18d
4 changed files with 5 additions and 3 deletions
|
|
@ -128,8 +128,8 @@ pub fn setup_tera(recipe: String, containerfile: Option<PathBuf>) -> Result<(Ter
|
|||
"print_module_context",
|
||||
|args: &HashMap<String, tera::Value>| -> tera::Result<tera::Value> {
|
||||
match args.get("module") {
|
||||
Some(v) => Ok(match serde_yaml::to_string(v) {
|
||||
Ok(s) => s.escape_default().collect::<String>(),
|
||||
Some(v) => Ok(match serde_json::to_string(v) {
|
||||
Ok(s) => s,
|
||||
Err(_) => "Unable to serialize".into(),
|
||||
}
|
||||
.into()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue