refactor template handling
This commit is contained in:
@@ -39,11 +39,11 @@ fn output_rendered_configs(rendered_config: RenderedConfig, outdir: &str, dbg: L
|
||||
.append(true)
|
||||
.open(&merged_config_path)
|
||||
.expect("unable to open");
|
||||
for rendered_template in rendered_config.configs {
|
||||
let template_path = out_path.join(rendered_template.0 + ".tera");
|
||||
for config in rendered_config.configs {
|
||||
let template_path = out_path.join(config.name + ".tera");
|
||||
verb!(dbg, " | {}", &template_path.display());
|
||||
write(&template_path, &rendered_template.1).ok();
|
||||
all_file.write_all(&rendered_template.1.as_bytes()).ok();
|
||||
write(&template_path, &config.data).ok();
|
||||
all_file.write_all(&config.data.as_bytes()).ok();
|
||||
}
|
||||
|
||||
let spec: String = yaml_serde::to_string(&rendered_config.spec).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user