Prevent error when piping bower output to head, fixes #1396

This commit is contained in:
Adam Stankiewicz
2014-09-07 23:43:39 +02:00
parent 138d846ecc
commit cd22a2d0c9

View File

@@ -30,6 +30,16 @@ function StandardRenderer(command, config) {
} else {
this._compact = process.stdout.columns < 120;
}
var exitOnPipeError = function (err) {
if (err.code === 'EPIPE') {
process.exit(0);
}
};
// It happens when piping command to "head" util
process.stdout.on('error', exitOnPipeError);
process.stderr.on('error', exitOnPipeError);
}
StandardRenderer.prototype.end = function (data) {