Github user stevengill commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/574#discussion_r132780726
--- Diff: src/cordova/restore-util.js ---
@@ -341,19 +340,29 @@ function installPluginsFromConfigXML (args) {
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null,
2), 'utf8');
}
}
- // Write config.xml (only if plugins exist in package.json).
+ // Write to config.xml (only if it is different from package.json in
content)
comboPluginIdArray.forEach(function (plugID) {
+ var configXMLPlugin = cfg.getPlugin(plugID);
if (pluginIdConfig.indexOf(plugID) < 0) {
pluginIdConfig.push(plugID);
- }
- cfg.removePlugin(plugID);
- if (mergedPluginSpecs[plugID]) {
+ if (mergedPluginSpecs[plugID]) {
+ cfg.removePlugin(plugID);
+ cfg.addPlugin({name: plugID, spec:
mergedPluginSpecs[plugID]}, comboObject[plugID]);
+ modifiedConfigXML = true;
+ } else {
+ cfg.removePlugin(plugID);
+ cfg.addPlugin({name: plugID}, comboObject[plugID]);
+ modifiedConfigXML = true;
+ }
+
+ // Write only if the plugin variables or specs are different from
pkgJson
+ } else if (((pluginIdConfig.indexOf(plugID) > 0) &&
(mergedPluginSpecs[plugID]) &&
+ ((configXMLPlugin.variables !== comboObject[plugID]))) ||
--- End diff --
I think you have an extra bracket around this one
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]