cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimir-kotikov <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...
Date Fri, 20 Feb 2015 19:19:12 GMT
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/170#discussion_r25095040
  
    --- Diff: cordova-lib/src/cordova/platform.js ---
    @@ -174,6 +181,24 @@ function addHelper(cmd, hooksRunner, projectRoot, targets, opts)
{
         });
     }
     
    +function save(hooksRunner, projectRoot, opts) {
    +    var xml = cordova_util.projectConfig(projectRoot);
    +    var cfg = new ConfigParser(xml);
    +
    +    // First, remove all platforms that are already in config.xml
    +    cfg.getEngines().map(function(engine){
    +        cfg.removeEngine();
    --- End diff --
    
    Something strange here. `removeEngine` requires an engine Id param (https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/configparser/ConfigParser.js#L404).
Probably should be `cfg.removeEngine(engine.id);` instead.
    Also `forEach` IMHO is more appropriate here than `map` here


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