From 7af51680dc0c175faa2cfe2b4d10ebecebd0c053 Mon Sep 17 00:00:00 2001 From: Jeff Zhao Date: Tue, 11 Jul 2023 16:08:51 -0400 Subject: remember to remove the file created by bulk_rename even if we don't complete the command --- src/commands/bulk_rename.rs | 2 ++ 1 file changed, 2 insertions(+) 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(()); } } -- cgit v1.2.3