From f03b751b10b8b59f339046fe5ab2e3b6c44f8a3e Mon Sep 17 00:00:00 2001 From: LegendEronZ Date: Sun, 14 Jun 2026 22:17:48 +0200 Subject: [PATCH] linux-rust: fix config file creation --- linux-rust/src/utils.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/linux-rust/src/utils.rs b/linux-rust/src/utils.rs index 88ee466a8..6cdb8518f 100644 --- a/linux-rust/src/utils.rs +++ b/linux-rust/src/utils.rs @@ -37,12 +37,15 @@ pub fn get_app_settings_path() -> PathBuf { let old_path = PathBuf::from(&data_dir) .join("app_settings.json"); - // migrate if needed - if old_path.exists() && !new_path.exists() { + // create new path if needed + if !new_path.exists() { if let Some(parent) = new_path.parent() { let _ = std::fs::create_dir_all(parent); } + } + // migrate if needed + if old_path.exists() { if std::fs::copy(&old_path, &new_path).is_ok() { let _ = std::fs::remove_file(&old_path); }