refactor template handling

This commit is contained in:
lost
2026-02-16 02:52:14 -07:00
parent 4177df0f4a
commit 00b067f89a
2 changed files with 14 additions and 6 deletions

View File

@@ -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();