MCPcopy Create free account
hub / github.com/facebook/memlab / runInProcess

Method runInProcess

packages/core/src/lib/ProcessManager.ts:62–80  ·  view source on GitHub ↗
(
    cmd: string,
    args: string[],
    options: Options = {},
  )

Source from the content-addressed store, hash-verified

60 }
61
62 private runInProcess(
63 cmd: string,
64 args: string[],
65 options: Options = {},
66 ): void {
67 if (options.msg) {
68 info.lowLevel(options.msg);
69 }
70 const str = utils.convertCLIArgsToReadableCommand([cmd, ...args]);
71 this.nProc++;
72 const proc = cp.spawn(cmd, args);
73 proc.on('exit', code => {
74 info.lowLevel(`done: ${str}`);
75 if (code !== 0) {
76 info.error(`fail: ${str}`);
77 }
78 this.freeProcess();
79 });
80 }
81}
82
83export default ProcessManager;

Callers 1

startMethod · 0.95

Calls 3

freeProcessMethod · 0.95
lowLevelMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected