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/07/28 02:55:24 UTC

cordova-lib git commit: CB-9414 plugin fetching now defaults to npm, CPR fallback

Repository: cordova-lib
Updated Branches:
  refs/heads/master 02ae8a20c -> 525a4b9a9


CB-9414 plugin fetching now defaults to npm, CPR fallback


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

Branch: refs/heads/master
Commit: 525a4b9a93263c7556a66dd60d892f803cec6359
Parents: 02ae8a2
Author: Steve Gill <st...@gmail.com>
Authored: Mon Jul 27 17:55:16 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Mon Jul 27 17:55:16 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/525a4b9a/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 bb9c216..52d3954 100644
--- a/cordova-lib/src/plugman/registry/registry.js
+++ b/cordova-lib/src/plugman/registry/registry.js
@@ -85,20 +85,17 @@ module.exports = {
     fetch: function(plugin, client) {
         plugin = plugin.shift();
         return Q.fcall(function() {
+            //fetch from npm
+            return fetchPlugin(plugin, client, true);
+        })
+        .fail(function(error) {
             //check to see if pluginID is reverse domain name style
-            if(isValidCprName(plugin)){
-                return Q();
+            if(isValidCprName(plugin)) {
+                //fetch from CPR
+                return fetchPlugin(plugin, client, false);
             } else {
-                //make promise fail so it will fetch from npm
-                events.emit('verbose', 'Skipping CPR');
-                return Q.reject();
+                return Q.reject(error);
             }
-        })
-        .then(function() {
-            return fetchPlugin(plugin, client, false);
-        })
-        .fail(function() {
-            return fetchPlugin(plugin, client, true);
         });
     },
 


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