MCPcopy Index your code
hub / github.com/Waishnav/devspace / terminateProcessTree

Function terminateProcessTree

src/process-platform.ts:59–77  ·  view source on GitHub ↗
(
  child: KillableProcess,
  signal: NodeJS.Signals,
  detached: boolean,
  runtime: ProcessTreeRuntime = defaultProcessTreeRuntime,
)

Source from the content-addressed store, hash-verified

57}
58
59export function terminateProcessTree(
60 child: KillableProcess,
61 signal: NodeJS.Signals,
62 detached: boolean,
63 runtime: ProcessTreeRuntime = defaultProcessTreeRuntime,
64): void {
65 if (runtime.platform === "win32" && child.pid) {
66 if (runtime.killWindowsTree(child.pid)) return;
67 } else if (detached && child.pid) {
68 try {
69 runtime.killGroup(child.pid, signal);
70 return;
71 } catch (error) {
72 if ((error as NodeJS.ErrnoException).code === "ESRCH") return;
73 }
74 }
75
76 child.kill(signal);
77}

Callers 2

startPipeMethod · 0.85

Calls 3

killWindowsTreeMethod · 0.80
killGroupMethod · 0.80
killMethod · 0.65

Tested by

no test coverage detected