fix(windows): stabilize test environment (#644)

* fix(windows): embed common-controls manifest

* fix(windows): prefer HOME for config paths

* test(windows): fix export_sql invalid path

* fix(windows): remove unused env import in config.rs
This commit is contained in:
Xyfer
2026-01-26 11:18:14 +08:00
committed by GitHub
parent a0ca8c2517
commit d99a3c2fee
7 changed files with 72 additions and 9 deletions
+11
View File
@@ -154,6 +154,17 @@ impl Default for AppSettings {
impl AppSettings {
fn settings_path() -> Option<PathBuf> {
// settings.json 保留用于旧版本迁移和无数据库场景
#[cfg(windows)]
if let Ok(home) = std::env::var("HOME") {
let trimmed = home.trim();
if !trimmed.is_empty() {
return Some(
PathBuf::from(trimmed)
.join(".cc-switch")
.join("settings.json"),
);
}
}
dirs::home_dir().map(|h| h.join(".cc-switch").join("settings.json"))
}