Skip to content

Commit

Permalink
fix: ensure parent directories are created when writing to disk in Me…
Browse files Browse the repository at this point in the history
…moryChunkFileCache
  • Loading branch information
sorrycc committed Jan 14, 2025
1 parent 23b7d34 commit eb9cc95
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/mako/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl MemoryChunkFileCache {
fn write_to_disk<T: AsRef<str>>(&self, path: T, content: &[u8]) -> Result<()> {
if let Some(root) = &self.root {
let path = root.join(path.as_ref());
fs::create_dir_all(path.parent().unwrap())?;
fs::write(path, content)?;
}
Ok(())
Expand Down

0 comments on commit eb9cc95

Please sign in to comment.