cp.on('exit', code => { if (code === 0) { displayNotification({ title: 'gulp', subtitle: 'Finished running tasks' }); } else { console.error(`Exited with error code ${code}`); displayNotification({ title: 'gulp', subtitle: `Exited with error code ${code}`, sound: 'Basso' }); } });
return function(err) { console.error(err); notify({ title: 'Error', subtitle: 'fail to compiling scripts', text: err, sound: 'Bottle' }); if (fn) { fn.call(err); } }
cp.stderr.on('data', data => { console.error(data); displayNotification({text: `[error] ${data}`}); });