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); }