function spawn (command, args, opts, cb) { if (!opts.stdio) opts.stdio = 'inherit' var child = crossSpawn(command, args, opts) child.on('error', cb) child.on('close', function (code) { if (code !== 0) return cb(new Error('non-zero exit code: ' + code)) cb(null) }) return child }
return new Promise((resolve, reject) => { const args = split(' ', commandLine) const spawned = crossSpawn(head(args), tail(args), options) const result = { stdout: null,
function spawn (command, args, opts, cb) { opts.stdio = debug.enabled ? 'inherit' : 'ignore' const child = crossSpawn(command, args, opts) child.on('error', cb) child.on('close', function (code) { if (code !== 0) return cb(new Error('Non-zero exit code: ' + code)) cb(null) }) return child }