cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omefire <...@git.apache.org>
Subject [GitHub] cordova-cli pull request: Telemetry
Date Wed, 11 May 2016 15:32:00 GMT
Github user omefire commented on a diff in the pull request:

    https://github.com/apache/cordova-cli/pull/247#discussion_r62870553
  
    --- 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 --
    
    Good point. This will end up requiring a rework of how the tests are structured, since
calling ```done()``` will end the promise chain.


---
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