Skip to content

Commit ca914fd

Browse files
committed
fix: correct openlist config path fix to target data_dir instead of temp_dir
The fix_openlist_config_paths() was being called on the temp copy, which was then deleted before being copied to the actual data directory. Now it correctly targets the file after it's been copied to data_dir.
1 parent 7a6a015 commit ca914fd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src-tauri/src/fs.rs

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

475-
// 将新配置从临时目录移动到数据目录
475+
// 复制新配置到数据目录
476476
for entry in fs::read_dir(&temp_dir)? {
477477
let entry = entry?;
478478
let src = entry.path();
479479
let dst = data_dir.join(entry.file_name());
480-
480+
481481
if src.is_dir() {
482482
copy_dir_all(&src, &dst)?;
483483
} else {
484484
fs::copy(&src, &dst)?;
485485
}
486486
}
487-
488-
// 修复 openlist/config.json 中的绝对路径
489-
let openlist_config_path = temp_dir.join("openlist/config.json");
487+
488+
// 修复 openlist/config.json 中的绝对路径(在 data_dir 中)
489+
let openlist_config_path = data_dir.join("openlist/config.json");
490490
if openlist_config_path.exists() {
491491
fix_openlist_config_paths(&openlist_config_path)?;
492492
}

0 commit comments

Comments
 (0)