MCPcopy Index your code
hub / github.com/tinyplex/tinybase / execute

Function execute

gulpfile.mjs:346–366  ·  view source on GitHub ↗
(cmd, showOutput = false)

Source from the content-addressed store, hash-verified

344};
345
346const execute = async (cmd, showOutput = false) => {
347 const {spawn} = await import('child_process');
348 return new Promise((resolve, reject) => {
349 const [command, ...args] = cmd.split(' ');
350 const child = spawn(command, args, showOutput ? {stdio: 'inherit'} : {});
351 let output = '';
352 if (!showOutput) {
353 child.stdout.on('data', (data) => (output += data.toString()));
354 child.stderr.on('data', (data) => (output += data.toString()));
355 }
356 child.on('close', (code) => {
357 if (code === 0) {
358 resolve();
359 } else {
360 // eslint-disable-next-line no-console
361 console.error(`Command failed with code ${code}: ${cmd}\n${output}`);
362 reject();
363 }
364 });
365 });
366};
367
368const lintCheckFiles = async (dir) => {
369 const {default: prettier} = await import('prettier');

Callers 7

spellCheckFunction · 0.85
npmInstallFunction · 0.85
npmPublishFunction · 0.85
tsFunction · 0.85
testBunFunction · 0.85
testE2eFunction · 0.85
testProdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…