From 5abea8dec9b0c651d1728e08d8efbd322e3d59db Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Fri, 26 Apr 2024 22:57:36 +0200 Subject: [PATCH] create parent directories --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 66f4847..8681195 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,6 +118,9 @@ fn convert_file(path: &Path) -> Result { let template = read_to_string(TEMPLATE_FILE)?; let html = template.replacen(CONTENT_MARKER, &html, 1); + DirBuilder::new() + .recursive(true) + .create(out_path.parent().unwrap())?; let mut file = File::create(&out_path)?; file.write_all(html.as_bytes())?; println!("built {}", out_path.display());