e534a911f3
Prettier v2 has the following breaking changes: * enforces spaces between `function` and params * enforces trailing commas by default
18 lines
469 B
JavaScript
18 lines
469 B
JavaScript
const childProcess = require('child_process');
|
|
|
|
module.exports = {
|
|
execNodeJsScriptWithInheritedOutput,
|
|
};
|
|
|
|
async function execNodeJsScriptWithInheritedOutput(command, args) {
|
|
return new Promise((resolve, reject) => {
|
|
const child = childProcess.fork(command, args, { stdio: 'inherit' });
|
|
child.on('close', (code) => {
|
|
if (code !== 0) {
|
|
reject(new Error(`Child process failed with exit-code ${code}`));
|
|
}
|
|
resolve();
|
|
});
|
|
});
|
|
}
|