Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-cli/pull/247#discussion_r62708439
  
    --- Diff: src/cli.js ---
    @@ -235,41 +317,58 @@ function cli(inputArgs) {
                 throw new CordovaError(msg);
             }
     
    -        cordova.raw[cmd].call(null, opts.platforms)
    -        .then(function (platformChecks) {
    +        var result = cordova.raw[cmd].call(null, opts.platforms)
    +            .then(function(platformChecks) {
     
    -            var someChecksFailed = 
Object.keys(platformChecks).map(function (platformName) {
    -                events.emit('log', '\nRequirements check results for ' + 
platformName + ':');
    -                var platformCheck = platformChecks[platformName];
    -                if (platformCheck instanceof CordovaError) {
    -                    events.emit('warn', 'Check failed for ' + platformName 
+ ' due to ' + platformCheck);
    -                    return true;
    -                }
    -
    -                var someChecksFailed = false;
    -                platformCheck.forEach(function (checkItem) {
    -                    var checkSummary = checkItem.name + ': ' +
    -                                    (checkItem.installed ? 'installed ' : 
'not installed ') +
    -                                    (checkItem.metadata.version || '');
    -                    events.emit('log', checkSummary);
    -                    if (!checkItem.installed) {
    -                        someChecksFailed = true;
    -                        events.emit('warn', checkItem.metadata.reason);
    +                var someChecksFailed = 
Object.keys(platformChecks).map(function(platformName) {
    +                    events.emit('log', '\nRequirements check results for ' 
+ platformName + ':');
    +                    var platformCheck = platformChecks[platformName];
    +                    if (platformCheck instanceof CordovaError) {
    +                        events.emit('warn', 'Check failed for ' + 
platformName + ' due to ' + platformCheck);
    +                        return true;
                         }
    +
    +                    var someChecksFailed = false;
    +                    platformCheck.forEach(function(checkItem) {
    +                        var checkSummary = checkItem.name + ': ' +
    +                            (checkItem.installed ? 'installed ' : 'not 
installed ') +
    +                            (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;
                     });
     
    -                return someChecksFailed;
    -            }).some(function (isCheckFailedForPlatform) {
    -                return isCheckFailedForPlatform;
    +                if (someChecksFailed) throw new CordovaError('Some of 
requirements check failed');
                 });
    -
    -            if (someChecksFailed) throw new CordovaError('Some of 
requirements check failed');
    -        }).done();
    --- End diff --
    
    Looks like you end up removing "done()" - does that not cause us to lose 
exceptions? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to