From 88a222d294539985cf337e6eaede573730f0730f Mon Sep 17 00:00:00 2001 From: forkless Date: Sun, 31 May 2026 23:12:01 +0200 Subject: [PATCH] Guard .ini delete: require backup first --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0c91311..c2e38f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -862,6 +862,16 @@ fn ini_delete_action( config_path: &Path, backup_root: &Path, ) -> Result<()> { + if !app.tui_state.has_ini_backup { + ok_dialog(terminal, app, "No Backup Found", + "No .ini backup directory found.\n\ + \n\ + Run \"Backup .ini files\" first to create a snapshot\n\ + before deleting the live .ini files.", + )?; + return Ok(()); + } + match ops::delete_ini_files(config_path, backup_root) { Ok(n) => { let msg = format!("Deleted {n} .ini file(s).\nThe game will regenerate defaults on next launch.");