mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
refactor(commands): improve terminal launch code structure and fix env vars
重构 open_provider_terminal 相关代码,提升可维护性和可读性。 主要改进: - 将 launch_terminal_with_env 拆分为多个职责单一的小函数 * write_claude_config: 写入配置文件 * escape_shell_path: 转义 shell 路径 * generate_wrapper_script: 生成包装脚本 * launch_macos_terminal / launch_linux_terminal / launch_windows_terminal: 平台特定启动逻辑 - 使用 let Some else 提前返回模式,减少嵌套 - 修复 Gemini 环境变量名为 GEMINI_API_KEY(而非 GOOGLE_API_KEY) - 完善临时文件清理逻辑: * macOS/Linux: 使用 trap EXIT 自动清理 * Windows: 批处理文件自删除 - 代码格式化和 import 排序优化 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,8 +25,8 @@ mod tray;
|
||||
mod usage_script;
|
||||
|
||||
pub use app_config::{AppType, McpApps, McpServer, MultiAppConfig};
|
||||
pub use commands::open_provider_terminal;
|
||||
pub use codex_config::{get_codex_auth_path, get_codex_config_path, write_codex_live_atomic};
|
||||
pub use commands::open_provider_terminal;
|
||||
pub use commands::*;
|
||||
pub use config::{get_claude_mcp_path, get_claude_settings_path, read_json_file};
|
||||
pub use database::Database;
|
||||
|
||||
Reference in New Issue
Block a user