mirror of
https://github.com/forkless/NotAlterra.git
synced 2026-08-16 16:37:27 +02:00
Use direct filesystem check for .ini backup guard
This commit is contained in:
+8
-1
@@ -864,7 +864,14 @@ fn ini_delete_action<B: Backend>(
|
||||
config_path: &Path,
|
||||
backup_root: &Path,
|
||||
) -> Result<()> {
|
||||
if !app.tui_state.has_ini_backup {
|
||||
let has_backup = backup_root.exists()
|
||||
&& std::fs::read_dir(backup_root)
|
||||
.map(|entries| entries.flatten().any(|e| {
|
||||
e.file_name().to_string_lossy().starts_with("ini_backup_")
|
||||
}))
|
||||
.unwrap_or(false);
|
||||
|
||||
if !has_backup {
|
||||
ok_dialog(terminal, app, "No Backup Found",
|
||||
"No .ini backup directory found.\n\
|
||||
\n\
|
||||
|
||||
Reference in New Issue
Block a user