Skip to content

Commit 003d633

Browse files
committed
add remove_and_create_dir_all in build_helper
1 parent 96984c0 commit 003d633

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
@@ -97,3 +97,9 @@ where
9797
Err(e) => Err(e),
9898
}
9999
}
100+
101+
pub fn remove_and_create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
102+
let path = path.as_ref();
103+
recursive_remove(path)?;
104+
fs::create_dir_all(path)
105+
}

0 commit comments

Comments
 (0)