summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2023-07-11 16:08:51 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2023-07-11 16:08:51 -0400
commit7af51680dc0c175faa2cfe2b4d10ebecebd0c053 (patch)
tree0c1a5d20f5ce7bddc0a9f6687c18b66755203fff
parentabb59d4684dd8eb13176a579dfa59d355fbc14e1 (diff)
remember to remove the file created by bulk_rename even if we don't complete the command
-rw-r--r--src/commands/bulk_rename.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/commands/bulk_rename.rs b/src/commands/bulk_rename.rs
index 6ba7f74..90dd23a 100644
--- a/src/commands/bulk_rename.rs
+++ b/src/commands/bulk_rename.rs
@@ -64,6 +64,8 @@ pub fn _bulk_rename(context: &mut AppContext) -> JoshutoResult {
// check if the file was modified since it was created
let last_modified = fs::metadata(&file_path)?.modified()?;
if last_modified <= initial_modified {
+ // remember to remove file
+ std::fs::remove_file(&file_path)?;
return Ok(());
}
}