Skip to content

Commit

Permalink
fix(utils): resolve input path in delete_dir_contents() if it's a link
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Apr 2, 2024
1 parent b4f8c1c commit 92e4da4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ where
}

pub(crate) fn delete_dir_contents(dir_path: &Path) {
match remove_dir_all::remove_dir_contents(dir_path) {
use remove_dir_all::RemoveDir;

match raw::open_dir_following_links(dir_path).and_then(|mut p| p.remove_dir_contents(None)) {
Err(e) if e.kind() != io::ErrorKind::NotFound => {
panic!("Unable to clean up {}: {:?}", dir_path.display(), e);
}
Expand Down

0 comments on commit 92e4da4

Please sign in to comment.