[ 
https://issues.apache.org/jira/browse/CB-10550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15148206#comment-15148206
 ] 

ASF GitHub Bot commented on CB-10550:
-------------------------------------

Github user TimBarham commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/387#discussion_r52976299
  
    --- Diff: cordova-lib/src/plugman/fetch.js ---
    @@ -132,10 +132,14 @@ function fetchPlugin(plugin_src, plugins_dir, 
options) {
                     ));
                 }
                 // If not found in local search path, fetch from the registry.
    -            var newID = pluginMapperotn[plugin_src];
    +            var splitVersion = plugin_src.split('@');
    +            var newID = pluginMapperotn[splitVersion[0]];
                 if(newID) {
                     events.emit('warn', 'Notice: ' + plugin_src + ' has been 
automatically converted to ' + newID + ' to be fetched from npm. This is due to 
our old plugins registry shutting down.');                
    --- End diff --
    
    Looks great, thanks @bso-intel!
    
    One small nit - use `splitVersion[0]` in the message instead of 
`plugin_src` (so, for example, we get `org.apache.cordova.device has been 
automatically converted to cordova-plugin-device to be fetched from npm` 
instead of `[email protected] has been automatically converted to 
cordova-plugin-device to be fetched from npm`).


> no plugin id mapper enforced when a version is specified
> --------------------------------------------------------
>
>                 Key: CB-10550
>                 URL: https://issues.apache.org/jira/browse/CB-10550
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib
>            Reporter: Byoungro So
>            Assignee: Byoungro So
>
> We now enforce the RDN-to-NPM plugin id mapping in various places in 
> CordovaLib.
> This works when there is no version is specified, but does not work when a 
> desired version is specified.
> For example, "cordova plugin add org.apache.cordova.device" will install 
> cordova-plugin-device.
> However "cordova plugin add [email protected]" will throw an 
> error message.
> {code}
> [a] cordova plugin add [email protected]
> Fetching plugin "[email protected]" via npm
> Fetching plugin "[email protected]" via cordova plugins registry
> Error: Failed to fetch plugin [email protected] via registry.
> Probably this is either a connection problem, or plugin spec is incorrect.
> Check your connection and plugin name/version/URL.
> Error: version not found: [email protected]{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to