Skip to content

Commit 0105ad7

Browse files
committed
add remove_and_create_dir_all in build_helper
1 parent 53b72c8 commit 0105ad7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/build_helper/src/fs/mod.rs

Lines changed: 6 additions & 0 deletions
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)