[
https://issues.apache.org/jira/browse/CB-12786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16035650#comment-16035650
]
ASF GitHub Bot commented on CB-12786:
-------------------------------------
Github user stevengill commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/555#discussion_r119971709
--- 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 --
I think it was due to packageJson.name potentially being different then
plugin.xml id field. But I don't know of any plugins with this and I'm not sure
it makes sense to have that distinction anymore.
> 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: [email protected]
For additional commands, e-mail: [email protected]