create parent before touching

This commit is contained in:
Jake Hillion 2022-04-09 19:42:22 +01:00
parent fc417c4e6c
commit 102dca0d4d

View File

@ -155,6 +155,9 @@ impl VoidBuilder {
if src_data.is_dir() { if src_data.is_dir() {
fs::create_dir_all(&dst)?; fs::create_dir_all(&dst)?;
} else { } else {
if let Some(parent) = dst.parent() {
fs::create_dir_all(parent)?;
}
fs::write(&dst, b"")?; fs::write(&dst, b"")?;
} }