fix nathan's problem

This commit is contained in:
Michael Zhang 2019-12-26 20:15:32 -06:00
parent 544877aed8
commit b55751f2c0
No known key found for this signature in database
GPG key ID: 5BAEFE5D04F0CE6C

View file

@ -25,10 +25,12 @@ pub fn empty(dry: bool, days: Option<u32>) -> Result<()> {
println!("{:?}", file.path);
} else {
fs::remove_file(file.info_path)?;
if file.deleted_path.is_dir() {
fs::remove_dir_all(file.deleted_path)?;
} else {
fs::remove_file(file.deleted_path)?;
if file.deleted_path.exists() {
if file.deleted_path.is_dir() {
fs::remove_dir_all(file.deleted_path)?;
} else {
fs::remove_file(file.deleted_path)?;
}
}
}
}