cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-12786) Improve logic for searching plugin id in case of module already exists in node_modules
Date Mon, 05 Jun 2017 09:33:04 GMT

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

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

Github user matrosov-nikita commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/555#discussion_r120073277
  
    --- Diff: cordova-fetch/index.js ---
    @@ -148,9 +148,15 @@ function trimID(target) {
             target = parts[1];
         }
     
    -    //If local path exists, set target to final directory
    +    // If local path exists, try to get plugin id from package.json or set target to
final directory
         if (fs.existsSync(target)) {
    -        target = path.basename(target);
    +        var pluginId, pkgJsonPath = path.join(target, 'package.json');
    +
    +        if (fs.existsSync(pkgJsonPath)) {
    +            pluginId = JSON.parse(fs.readFileSync(pkgJsonPath)).cordova.id;
    --- End diff --
    
    @stevengill, I could not find plugins in which `cordova.id` differs from the `name`. PR
has been updated.


> Improve logic for searching plugin id in case of module already exists in node_modules
> --------------------------------------------------------------------------------------
>
>                 Key: CB-12786
>                 URL: https://issues.apache.org/jira/browse/CB-12786
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-fetch
>    Affects Versions: 1.1.0
>         Environment:  cordova-7.0.2-dev
>            Reporter: Nikita Matrosov
>            Assignee: Nikita Matrosov
>              Labels: cordova-next
>
> Steps to reproduce
> There is the issue with searching plugin id if the module already exists in node_modules.
> cordova create sample
> cordova platform add android
> cordova plugin add cordova-plugin-ms-adal
> cordova plugin add ../azure-activedirectory-library-for-cordova (use local folder)
> Get error message:
> Error: Failed to get absolute path to installed module
> This error occurs since folder name in node_modules (cordova-plugin-ms-adal) differs
from base name of installation folder (azure-activedirectory-library-for-cordova).
> PR: https://github.com/apache/cordova-lib/pull/555



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message