mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Revert "oops" This reverts commit2be0f1d8cd. Revert "cleanup top level gulpfile" This reverts commit849311713d. Revert "use strict" This reverts commitb6b7e82041. Revert "forgot top level" This reverts commit1552828709. Revert "remove VSCODE_BUILD_QUIET" This reverts commit8df5e70d12.
57 lines
1.2 KiB
JavaScript
57 lines
1.2 KiB
JavaScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
var es = require('event-stream');
|
|
var _ = require('underscore');
|
|
|
|
var allErrors = [];
|
|
var count = 0;
|
|
|
|
function onStart() {
|
|
if (count++ > 0) {
|
|
return;
|
|
}
|
|
|
|
console.log('*** Starting...');
|
|
}
|
|
|
|
function onEnd() {
|
|
if (--count > 0) {
|
|
return ;
|
|
}
|
|
|
|
var errors = _.flatten(allErrors);
|
|
errors.map(function (err) { console.error('*** Error:', err); });
|
|
console.log('*** Finished with', errors.length, 'errors.');
|
|
}
|
|
|
|
module.exports = function () {
|
|
var errors = [];
|
|
allErrors.push(errors);
|
|
|
|
var result = function (err) {
|
|
errors.push(err);
|
|
};
|
|
|
|
result.end = function (emitError) {
|
|
errors.length = 0;
|
|
onStart();
|
|
return es.through(null, function () {
|
|
onEnd();
|
|
|
|
if (emitError && errors.length > 0) {
|
|
this.emit('error', 'Errors occurred.');
|
|
} else {
|
|
this.emit('end');
|
|
}
|
|
});
|
|
};
|
|
|
|
result.hasErrors = function() {
|
|
return errors.length > 0;
|
|
}
|
|
|
|
return result;
|
|
}; |