create parent directories

This commit is contained in:
Crispy 2024-04-26 22:57:36 +02:00
parent 8736fa8638
commit 5abea8dec9

View file

@ -118,6 +118,9 @@ fn convert_file(path: &Path) -> Result {
let template = read_to_string(TEMPLATE_FILE)?; let template = read_to_string(TEMPLATE_FILE)?;
let html = template.replacen(CONTENT_MARKER, &html, 1); let html = template.replacen(CONTENT_MARKER, &html, 1);
DirBuilder::new()
.recursive(true)
.create(out_path.parent().unwrap())?;
let mut file = File::create(&out_path)?; let mut file = File::create(&out_path)?;
file.write_all(html.as_bytes())?; file.write_all(html.as_bytes())?;
println!("built {}", out_path.display()); println!("built {}", out_path.display());