Skip to content

Commit

Permalink
Merge pull request apache#335 from purplecabbage/CB-13740
Browse files Browse the repository at this point in the history
CB-13740 safe requirements check
  • Loading branch information
purplecabbage authored Sep 25, 2018
2 parents f8ed27c + f10a371 commit 890d336
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,21 @@ function cli (inputArgs) {
}

var someChecksFailed = false;
platformCheck.forEach(function (checkItem) {
var checkSummary = checkItem.name + ': ' +
(checkItem.installed ? 'installed ' : 'not installed ') +
(checkItem.installed ? checkItem.metadata.version.version || checkItem.metadata.version : '');
events.emit('log', checkSummary);
if (!checkItem.installed) {
someChecksFailed = true;
events.emit('warn', checkItem.metadata.reason);
}
});

// platformCheck is expected to be an array of conditions that must be met
// the browser platform currently returns nothing, which was breaking here.
if (platformCheck && platformCheck.forEach) {
platformCheck.forEach(function (checkItem) {
var checkSummary = checkItem.name + ': ' +
(checkItem.installed ? 'installed ' : 'not installed ') +
(checkItem.installed ? checkItem.metadata.version.version || checkItem.metadata.version : '');
events.emit('log', checkSummary);
if (!checkItem.installed) {
someChecksFailed = true;
events.emit('warn', checkItem.metadata.reason);
}
});
}
return someChecksFailed;
}).some(function (isCheckFailedForPlatform) {
return isCheckFailedForPlatform;
Expand Down

0 comments on commit 890d336

Please # to comment.