[
https://issues.apache.org/jira/browse/CB-8551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14345109#comment-14345109
]
ASF GitHub Bot commented on CB-8551:
------------------------------------
Github user agrieve commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/175#discussion_r25690367
--- Diff: cordova-lib/src/cordova/plugin.js ---
@@ -238,7 +239,21 @@ module.exports = function plugin(command, targets,
opts) {
return opts.plugins.reduce(function(soFar, target) {
// Check if we have the plugin.
if (plugins.indexOf(target) < 0) {
- return Q.reject(new CordovaError('Plugin "' +
target + '" is not present in the project. See `'+cordova_util.binname+' plugin
list`.'));
+ // Convert target from package-name to package-id
if necessary
+ var keys = Object.keys(pluginMapper);
+ //Traverse through pluginMapper values to see if
it equals our target.
+ //Cordova-plugin-device would get changes to
org.apache.cordova.device
+ for (var i = 0; i < keys.length; i++) {
--- End diff --
Might as well export the reverse mapping from pluginMapper so that you
don't need to do this linear search. Exposing the map as a sub-key of the
module is a good idea anyways, since doing it top-level restricts you from ever
adding another symbol to it.
> Setup fetching from npm as fallback
> -----------------------------------
>
> Key: CB-8551
> URL: https://issues.apache.org/jira/browse/CB-8551
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaLib
> Reporter: Steve Gill
> Assignee: Steve Gill
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]