MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / run

Function run

graph-ui/tools/freshclone-check.mjs:81–99  ·  view source on GitHub ↗
(command, args, cwd, extraEnv = {})

Source from the content-addressed store, hash-verified

79});
80
81function run(command, args, cwd, extraEnv = {}) {
82 const started = Date.now();
83 return new Promise((done) => {
84 const child = spawn(command, args, {
85 cwd,
86 env: { ...childEnv(), ...extraEnv },
87 stdio: ['ignore', 'pipe', 'pipe'],
88 });
89 let out = '';
90 child.stdout.on('data', (chunk) => {
91 out += chunk.toString();
92 });
93 child.stderr.on('data', (chunk) => {
94 out += chunk.toString();
95 });
96 child.on('error', (error) => done({ code: 127, out: out + error.message, ms: Date.now() - started }));
97 child.on('close', (code) => done({ code: code ?? 1, out, ms: Date.now() - started }));
98 });
99}
100
101/** Der letzte Rest einer Ausgabe, so viel wie in einen Bericht gehoert. */
102const tail = (text, lines = 12) =>

Callers 1

mainFunction · 0.70

Calls 1

childEnvFunction · 0.85

Tested by

no test coverage detected