Skip to content

Commit 525a4b9

Browse files
committed
CB-9414 plugin fetching now defaults to npm, CPR fallback
1 parent 02ae8a2 commit 525a4b9

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

cordova-lib/src/plugman/registry/registry.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,17 @@ module.exports = {
8585
fetch: function(plugin, client) {
8686
plugin = plugin.shift();
8787
return Q.fcall(function() {
88+
//fetch from npm
89+
return fetchPlugin(plugin, client, true);
90+
})
91+
.fail(function(error) {
8892
//check to see if pluginID is reverse domain name style
89-
if(isValidCprName(plugin)){
90-
return Q();
93+
if(isValidCprName(plugin)) {
94+
//fetch from CPR
95+
return fetchPlugin(plugin, client, false);
9196
} else {
92-
//make promise fail so it will fetch from npm
93-
events.emit('verbose', 'Skipping CPR');
94-
return Q.reject();
97+
return Q.reject(error);
9598
}
96-
})
97-
.then(function() {
98-
return fetchPlugin(plugin, client, false);
99-
})
100-
.fail(function() {
101-
return fetchPlugin(plugin, client, true);
10299
});
103100
},
104101

0 commit comments

Comments
 (0)