Skip to content

Commit 00cc0a5

Browse files
committed
add remove_and_create_dir_all in build_helper
1 parent 4af8888 commit 00cc0a5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/build_helper/src/fs/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,9 @@ where
9696
Err(e) => Err(e),
9797
}
9898
}
99+
100+
pub fn remove_and_create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
101+
let path = path.as_ref();
102+
recursive_remove(path)?;
103+
fs::create_dir_all(path)
104+
}

0 commit comments

Comments
 (0)