mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Merge pull request #722 from wibblymat/reject-on-spawn-error
Reject the promise for a command if an error event is fired
This commit is contained in:
@@ -68,6 +68,11 @@ function cmd(command, args, options) {
|
||||
stderr += data;
|
||||
});
|
||||
|
||||
// If there is an error spawning the command, reject the promise
|
||||
process.on('error', function (error) {
|
||||
return deferred.reject(error)
|
||||
});
|
||||
|
||||
// Listen to the close event instead of exit
|
||||
// They are similar but close ensures that streams are flushed
|
||||
process.on('close', function (code) {
|
||||
|
||||
Reference in New Issue
Block a user