MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / spawnAsync

Function spawnAsync

gulpfile.js:207–225  ·  view source on GitHub ↗
(command, args)

Source from the content-addressed store, hash-verified

205gulp.task('checkDependencies', gulp.series('checkNativeDependencies', 'checkNpmDependencies'));
206
207function spawnAsync(command, args) {
208 return new Promise((resolve, reject) => {
209 let stdOut = '';
210 console.info(`> ${command} ${args.join(' ')}`);
211 const proc = spawn(command, args, { cwd: __dirname, env: process.env });
212 proc.stdout.on('data', (data) => {
213 // Log output on CI (else travis times out when there's not output).
214 stdOut += data.toString();
215 if (isCI) {
216 console.log(data.toString());
217 }
218 });
219 proc.stderr.on('data', (data) => {
220 console.error(data.toString());
221 });
222 proc.on('close', () => resolve(stdOut));
223 proc.on('error', (error) => reject(error));
224 });
225}
226
227function hasNativeDependencies() {
228 let nativeDependencies = nativeDependencyChecker.check(path.join(__dirname, 'node_modules'));

Callers

nothing calls this directly

Calls 8

spawnFunction · 0.85
joinMethod · 0.80
logMethod · 0.80
infoMethod · 0.65
onMethod · 0.65
toStringMethod · 0.65
errorMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected