mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Prevent error when piping bower output to head, fixes #1396
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user