You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2015/03/06 01:26:53 UTC

[17/27] cordova-lib git commit: CB-8551 cleaned up initSetings function

CB-8551 cleaned up initSetings function


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/305cecb9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/305cecb9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/305cecb9

Branch: refs/heads/master
Commit: 305cecb9d67e9b0b349db1b22e91400d97bb2306
Parents: cfdcc06
Author: Steve Gill <st...@gmail.com>
Authored: Tue Mar 3 16:19:11 2015 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Tue Mar 3 16:19:11 2015 -0800

----------------------------------------------------------------------
 cordova-lib/src/plugman/registry/registry.js | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/305cecb9/cordova-lib/src/plugman/registry/registry.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/registry/registry.js b/cordova-lib/src/plugman/registry/registry.js
index 743f8e8..fba5053 100644
--- a/cordova-lib/src/plugman/registry/registry.js
+++ b/cordova-lib/src/plugman/registry/registry.js
@@ -205,16 +205,20 @@ module.exports = {
 
 /**
  * @method initSettings
- * @param {Boolean} using npm registry
+ * @param {Boolean} determines if we are using the npm registry
  * @return {Promise.<Object>} Promised settings.
  */
-function initSettings(npm) {
+function initSettings(useNpmRegistry) {
     var settings = module.exports.settings;
-    var registryURL = 'http://registry.cordova.io';
+    const NPM_REG_URL = 'http://registry.npmjs.org';
+    const CPR_REG_URL = 'http://registry.cordova.io';
+    var registryURL;
 
-    //if npm is true, use npm registry
-    if(npm) {
-        registryURL = 'http://registry.npmjs.org';
+    //if useNpmRegistry is true, use npm registry
+    if(useNpmRegistry) {
+        registryURL = NPM_REG_URL;
+    } else {
+        registryURL = CPR_REG_URL;
     }
 
     // check if settings already set
@@ -240,8 +244,8 @@ function initSettings(npm) {
     // if npm is true, use npm registry. 
     // ~/.plugman/config overides the above config if it exists. 
     // Need to reset the registry value in settings 
-    if(npm) {
-        settings.registry = 'http://registry.npmjs.org';
+    if(useNpmRegistry) {
+        settings.registry = NPM_REG_URL;
     }
 
     return Q(settings);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org