cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevengill <...@git.apache.org>
Subject [GitHub] cordova-lib pull request #574: CB-12838 : prevented sorting and alphabetizin...
Date Fri, 11 Aug 2017 20:55:18 GMT
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/574#discussion_r132781446
  
    --- 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]))) ||
    +            ((mergedPluginSpecs[plugID] !== configXMLPlugin.spec) ||
    --- End diff --
    
    so to confirm, either `((pluginIdConfig.indexOf(plugID) > 0) && (mergedPluginSpecs[plugID])
&&(configXMLPlugin.variables !== comboObject[plugID]))` or `((mergedPluginSpecs[plugID]
!== configXMLPlugin.spec) || (configXMLPlugin.variables !== comboObject[plugID]))` need to
be true


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