* feat(env): add environment variable conflict detection and management 实现了系统环境变量冲突检测与管理功能: 核心功能: - 自动检测会影响 Claude/Codex 的系统环境变量 - 支持 Windows 注册表和 Unix shell 配置文件检测 - 提供可视化的环境变量冲突警告横幅 - 支持批量选择和删除环境变量 - 删除前自动备份,支持后续恢复 技术实现: - Rust 后端: 跨平台环境变量检测与管理 - React 前端: EnvWarningBanner 组件交互界面 - 国际化支持: 中英文界面 - 类型安全: 完整的 TypeScript 类型定义 * refactor(env): remove unused imports and function Remove unused HashMap and PathBuf imports, and delete the unused get_source_description function to clean up the code.
21 lines
732 B
Rust
21 lines
732 B
Rust
use crate::services::env_checker::{check_env_conflicts as check_conflicts, EnvConflict};
|
|
use crate::services::env_manager::{delete_env_vars as delete_vars, restore_from_backup, BackupInfo};
|
|
|
|
/// Check environment variable conflicts for a specific app
|
|
#[tauri::command]
|
|
pub fn check_env_conflicts(app: String) -> Result<Vec<EnvConflict>, String> {
|
|
check_conflicts(&app)
|
|
}
|
|
|
|
/// Delete environment variables with backup
|
|
#[tauri::command]
|
|
pub fn delete_env_vars(conflicts: Vec<EnvConflict>) -> Result<BackupInfo, String> {
|
|
delete_vars(conflicts)
|
|
}
|
|
|
|
/// Restore environment variables from backup file
|
|
#[tauri::command]
|
|
pub fn restore_env_backup(backup_path: String) -> Result<(), String> {
|
|
restore_from_backup(backup_path)
|
|
}
|