Fix reset_directory function

Before it was not deleting non-empty directories.
This commit is contained in:
Jakub Beránek 2023-09-12 19:32:46 +02:00
parent f17047bc90
commit a2ed508f54
No known key found for this signature in database
GPG Key ID: 909CD0D26483516B

View File

@ -7,7 +7,7 @@ use std::path::Path;
/// Delete and re-create the directory.
pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> {
log::info!("Resetting directory {path}");
let _ = std::fs::remove_dir(path);
let _ = std::fs::remove_dir_all(path);
std::fs::create_dir_all(path)?;
Ok(())
}