mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 21:30:17 +08:00
feat: add silent install/update lifecycle for managed CLI tools
Expand tool version detection to all six managed apps (including Hermes via PyPI), and add a run_tool_lifecycle_action command that installs or updates CLI tools silently: it captures the subprocess output and blocks until the command actually finishes instead of popping a terminal window (Windows uses CREATE_NO_WINDOW). On failure the last lines of stderr are returned so the UI can surface a useful message. Also restores the Windows version-detection path by gating try_get_version behind cfg(not(windows)) so it no longer risks triggering the App Execution Alias / protocol handler that previously disabled Windows.
This commit is contained in:
@@ -192,6 +192,21 @@ export const settingsApi = {
|
||||
return await invoke("get_tool_versions", { tools, wslShellByTool });
|
||||
},
|
||||
|
||||
async runToolLifecycleAction(
|
||||
tools: string[],
|
||||
action: "install" | "update",
|
||||
wslShellByTool?: Record<
|
||||
string,
|
||||
{ wslShell?: string | null; wslShellFlag?: string | null }
|
||||
>,
|
||||
): Promise<void> {
|
||||
await invoke("run_tool_lifecycle_action", {
|
||||
tools,
|
||||
action,
|
||||
wslShellByTool,
|
||||
});
|
||||
},
|
||||
|
||||
async getRectifierConfig(): Promise<RectifierConfig> {
|
||||
return await invoke("get_rectifier_config");
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user