MCPcopy
hub / github.com/iterative/cml / exec

Function exec

src/utils.js:26–44  ·  view source on GitHub ↗
(file, ...args)

Source from the content-addressed store, hash-verified

24const waitForever = () => new Promise((resolve) => resolve);
25
26const exec = async (file, ...args) => {
27 return new Promise((resolve, reject) => {
28 require('child_process').execFile(
29 file,
30 args,
31 { ...process.env },
32 (error, stdout, stderr) => {
33 if (!process.stdout.isTTY) {
34 stdout = stripAnsi(stdout);
35 stderr = stripAnsi(stderr);
36 }
37 if (error)
38 reject(new Error(`${[file, ...args]}\n\t${stdout}\n\t${stderr}`));
39
40 resolve((stdout || stderr).slice(0, -1));
41 }
42 );
43 });
44};
45
46const mimeType = async (opts) => {
47 const { path, buffer } = opts;

Callers 15

versionFunction · 0.85
initFunction · 0.85
destroyFunction · 0.85
utils.test.jsFile · 0.85
revParseMethod · 0.85
branchMethod · 0.85
ciMethod · 0.85
prCreateMethod · 0.85
userIdFunction · 0.85
gpuPresentFunction · 0.85
unregisterRunnerMethod · 0.85
startRunnerMethod · 0.85

Calls

no outgoing calls

Tested by 2

launchRunnerFunction · 0.68
rmTbDevExperimentFunction · 0.68