cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhilkh <...@git.apache.org>
Subject [GitHub] cordova-cli pull request: Telemetry
Date Tue, 10 May 2016 16:48:35 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message