fix(tauri): ensure ~/.claude directory exists before copying provider settings into main settings file
This commit is contained in:
@@ -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)?;
|
copy_file(&provider_config_path, &settings_path)?;
|
||||||
|
|
||||||
@@ -177,4 +183,4 @@ impl ProviderManager {
|
|||||||
pub fn get_all_providers(&self) -> &HashMap<String, Provider> {
|
pub fn get_all_providers(&self) -> &HashMap<String, Provider> {
|
||||||
&self.providers
|
&self.providers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user