mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-02 10:21:16 +08:00
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:
@@ -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"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user