MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / run

Function run

packages/node-sdk/scripts/build-dts.mjs:37–55  ·  view source on GitHub ↗
(command, binPath, args)

Source from the content-addressed store, hash-verified

35}
36
37function run(command, binPath, args) {
38 return new Promise((resolve, reject) => {
39 const child = spawn(process.execPath, [binPath, ...args], {
40 cwd: packageRoot,
41 stdio: 'inherit',
42 });
43
44 child.once('error', reject);
45 child.once('exit', (code, signal) => {
46 if (code === 0) {
47 resolve();
48 return;
49 }
50
51 const detail = signal === null ? `exit code ${String(code)}` : `signal ${signal}`;
52 reject(new Error(`${command} failed with ${detail}`));
53 });
54 });
55}
56
57async function writeProviderClientShim() {
58 await mkdir(dtsRoot, { recursive: true });

Callers 1

build-dts.mjsFile · 0.70

Calls 4

rejectFunction · 0.85
onceMethod · 0.65
spawnFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected