MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / runCommand

Method runCommand

src/integrations/terminal/ExecaTerminal.ts:18–37  ·  view source on GitHub ↗
(command: string, callbacks: RooTerminalCallbacks)

Source from the content-addressed store, hash-verified

16 }
17
18 public override runCommand(command: string, callbacks: RooTerminalCallbacks): RooTerminalProcessResultPromise {
19 this.busy = true
20
21 const process = new ExecaTerminalProcess(this)
22 process.command = command
23 this.process = process
24
25 process.on("line", (line) => callbacks.onLine(line, process))
26 process.once("completed", (output) => callbacks.onCompleted(output, process))
27 process.once("shell_execution_started", (pid) => callbacks.onShellExecutionStarted(pid, process))
28 process.once("shell_execution_complete", (details) => callbacks.onShellExecutionComplete(details, process))
29
30 const promise = new Promise<void>((resolve, reject) => {
31 process.once("continue", () => resolve())
32 process.once("error", (error) => reject(error))
33 process.run(command)
34 })
35
36 return mergePromise(process, promise)
37 }
38}

Callers

nothing calls this directly

Calls 4

runMethod · 0.95
mergePromiseFunction · 0.90
onMethod · 0.65
onceMethod · 0.45

Tested by

no test coverage detected