[
https://issues.apache.org/jira/browse/CB-8499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14329388#comment-14329388
]
ASF GitHub Bot commented on CB-8499:
------------------------------------
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
> 'cordova platform save' : should save all installed platforms to config.xml
> ---------------------------------------------------------------------------
>
> Key: CB-8499
> URL: https://issues.apache.org/jira/browse/CB-8499
> Project: Apache Cordova
> Issue Type: New Feature
> Reporter: Omar Mefire
> Assignee: Omar Mefire
>
> In addition to using 'cordova platform add android --save' to both add and
> save a platform to config.xml, It would be useful to have a way to 'mass
> save' already installed platforms to config.xml.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]