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

Function run

apps/kimi-code/scripts/native/exec.mjs:28–45  ·  view source on GitHub ↗
(command, args, options = {})

Source from the content-addressed store, hash-verified

26}
27
28export async function run(command, args, options = {}) {
29 const exec = commandForExecFile(command, args);
30 try {
31 const { stdout, stderr } = await execFileAsync(exec.command, exec.args, {
32 cwd: appRoot,
33 maxBuffer: 1024 * 1024 * 16,
34 ...exec.options,
35 ...options,
36 });
37 if (stdout.trim()) console.log(stdout.trim());
38 if (stderr.trim()) console.error(stderr.trim());
39 } catch (error) {
40 const details = [error.stdout?.trim(), error.stderr?.trim(), error.message]
41 .filter(Boolean)
42 .join('\n');
43 fail(`Command failed: ${basename(command)} ${args.join(' ')}\n${details}`);
44 }
45}
46
47export async function tryRun(command, args, options = {}) {
48 const exec = commandForExecFile(command, args);

Callers 11

runBundleStepFunction · 0.90
runSeaBlobStepFunction · 0.90
runVerifyStepFunction · 0.90
copyNodeExecutableFunction · 0.90
injectSeaBlobFunction · 0.90
build.mjsFile · 0.90
runSignStepFunction · 0.90
runActionFunction · 0.50
handleRunCommandFunction · 0.50
beginMigrationMethod · 0.50

Calls 5

commandForExecFileFunction · 0.85
basenameFunction · 0.85
failFunction · 0.70
logMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected