From b18ada61c7a7a363e674e39e2539bb45b5e259a8 Mon Sep 17 00:00:00 2001 From: pyro Date: Wed, 30 Sep 2026 11:56:58 -0500 Subject: [PATCH] updated the promote project folder clean up to leave the folders there if there are still projects. --- src/appstate.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/appstate.rs b/src/appstate.rs index ea58dff..67d44aa 100644 --- a/src/appstate.rs +++ b/src/appstate.rs @@ -2101,8 +2101,20 @@ impl AppState { let mut old_notes = new_project.notes.clone(); old_files.pop(); old_notes.pop(); - remove_dir_all(&old_files)?; - remove_dir_all(&old_notes)?; + remove_dir_all(&new_project.files)?; + remove_dir_all(&new_project.notes)?; + if let Err(_) = remove_dir(old_files) { + self.main_tx.send(ToolMessage::Output(( + rid, + String::from("organization files folder is not empty and will not be deleted."), + )))?; + } + if let Err(_) = remove_dir(old_notes) { + self.main_tx.send(ToolMessage::Output(( + rid, + String::from("organization notes folder is not empty and will not be deleted."), + )))?; + } new_files_path.push(&new_project.name); new_notes_path.push(&new_project.name); new_project.files(new_files_path.clone());