Github user TimBarham commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/175#discussion_r25746864
--- Diff: cordova-lib/src/plugman/registry/registry.js ---
@@ -218,10 +205,18 @@ module.exports = {
/**
* @method initSettings
+ * @param {Boolean} using npm registry
* @return {Promise.<Object>} Promised settings.
*/
-function initSettings() {
+function initSettings(npm) {
var settings = module.exports.settings;
+ var registryURL = 'http://registry.cordova.io';
+
+ //if npm is true, use npm registry
+ if(npm) {
+ registryURL = 'http://registry.npmjs.org';
+ }
+
--- End diff --
Ok, fair enough - I get some people don't like `?:`. The usual alternative
is:
var registryURL;
if (npm) {
registryURL = 'http://registry.npmjs.org';
} else {
registryURL = 'http://registry.cordova.io';
}
I know this is slightly more verbose, but I think it is cleaner code than
assigning something, then immediately assigning something else if a condition
is true. That said, it's only a minor nit so I won't complain very loudly if
you leave it as is :).
---
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]