fix(tauri): ensure ~/.claude directory exists before copying provider settings into main settings file

This commit is contained in:
Jason
2025-08-24 23:35:44 +08:00
parent f3f484a04b
commit 95549473bd

View File

@@ -154,6 +154,12 @@ impl ProviderManager {
}
}
// 确保主配置父目录存在
if let Some(parent) = settings_path.parent() {
std::fs::create_dir_all(parent)
.map_err(|e| format!("创建目录失败: {}", e))?;
}
// 复制新供应商配置到主配置
copy_file(&provider_config_path, &settings_path)?;
@@ -177,4 +183,4 @@ impl ProviderManager {
pub fn get_all_providers(&self) -> &HashMap<String, Provider> {
&self.providers
}
}
}