Skip to content

Commit be14b85

Browse files
authored
fix: ensure output directory exists before writing component (#198)
1 parent 79e98c3 commit be14b85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,10 @@ pub async fn componentize(
704704
)
705705
})?;
706706

707+
// Checks if the output directory exists, and creates it if it doesn't.
708+
if let Some(parent) = output_path.parent() {
709+
fs::create_dir_all(parent)?;
710+
}
707711
fs::write(output_path, component)?;
708712

709713
Ok(())

0 commit comments

Comments
 (0)