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

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

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

    https://github.com/apache/cordova-lib/pull/162#discussion_r24500705
  
    --- Diff: cordova-lib/src/cordova/plugin.js ---
    @@ -114,6 +116,22 @@ module.exports = function plugin(command, targets, 
opts) {
                                 target = target.substring(0, target.length - 
1);
                             }
     
    +                        var parts = target.split('@');
    +                        var id = parts[0];
    +                        var version = parts[1];
    +
    +                        // If no version is specified, retrieve the 
version from config.xml
    +                        if(!version && !cordova_util.isUrl(id) && 
!cordova_util.isDirectory(id)){
    +                            events.emit('verbose', 'no version specified, 
retrieving version from config.xml');
    +                            var ver = getVersionFromConfigFile(id, cfg);
    +
    +                            if( cordova_util.isUrl(ver) || 
cordova_util.isDirectory(ver) ){
    --- End diff --
    
    isDirectory don't check for null/undefined. Should either add that to 
isDirectory, or add check here.


> 'cordova plugin add' should look into config.xml for correct feature element 
> when no version is provided
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CB-8420
>                 URL: https://issues.apache.org/jira/browse/CB-8420
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: CordovaLib
>            Reporter: Omar Mefire
>            Assignee: Omar Mefire
>




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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to