Skip to content

Commit 9cd16ec

Browse files
committed
fix: apply path fixes BEFORE copying config to data_dir
The previous fix was applied after copying, so the fixed file was overwritten. Now fix_openlist_config_paths() is called on temp_dir BEFORE copying to data_dir.
1 parent 4689402 commit 9cd16ec

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src-tauri/src/fs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ pub fn import_config(
472472
}
473473
}
474474

475+
// 先修复 openlist/config.json 中的绝对路径(在 temp_dir 中)
476+
let temp_openlist_config_path = temp_dir.join("openlist/config.json");
477+
if temp_openlist_config_path.exists() {
478+
fix_openlist_config_paths(&temp_openlist_config_path)?;
479+
}
480+
475481
// 复制新配置到数据目录
476482
for entry in fs::read_dir(&temp_dir)? {
477483
let entry = entry?;
@@ -485,12 +491,6 @@ pub fn import_config(
485491
}
486492
}
487493

488-
// 修复 openlist/config.json 中的绝对路径(在 data_dir 中)
489-
let openlist_config_path = data_dir.join("openlist/config.json");
490-
if openlist_config_path.exists() {
491-
fix_openlist_config_paths(&openlist_config_path)?;
492-
}
493-
494494
// 清理临时目录
495495
fs::remove_dir_all(&temp_dir)?;
496496

0 commit comments

Comments
 (0)