Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(function(resolve, reject) {
console.log('>>>', cmd.join(' '));
childProcess.spawn(cmd[0], cmd.slice(1), {
cwd: mwpath,
env: process.env,
stdio: 'inherit',
}).on('close', function(code) {
if (code === 0) {
resolve(code);
} else {
reject(code);
}
}).on('error', reject);
});
};