Skip to content

Commit cb27b9b

Browse files
committed
fix(utils): resolve input path in delete_dir_contents() if it's a link
1 parent fe93d5b commit cb27b9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/utils.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,9 @@ where
611611
}
612612

613613
pub(crate) fn delete_dir_contents(dir_path: &Path) {
614-
match remove_dir_all::remove_dir_contents(dir_path) {
614+
use remove_dir_all::RemoveDir;
615+
616+
match raw::open_dir_following_links(dir_path).and_then(|mut p| p.remove_dir_contents(None)) {
615617
Err(e) if e.kind() != io::ErrorKind::NotFound => {
616618
panic!("Unable to clean up {}: {:?}", dir_path.display(), e);
617619
}

0 commit comments

Comments
 (0)