You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2013/12/19 16:32:17 UTC
[jira] [Commented] (CB-5674) Installing plugins programatically
using the cordova cli npm module fails due to promise issue
[ https://issues.apache.org/jira/browse/CB-5674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13852968#comment-13852968 ]
ASF subversion and git services commented on CB-5674:
-----------------------------------------------------
Commit d7e3e896fb59cd0c56088f6e7a609900fb5b3dd3 in branch refs/heads/master from [~agrieve]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-cli.git;h=d7e3e89 ]
CB-5674 Don't install plugins in parallel when adding a platform.
> Installing plugins programatically using the cordova cli npm module fails due to promise issue
> ----------------------------------------------------------------------------------------------
>
> Key: CB-5674
> URL: https://issues.apache.org/jira/browse/CB-5674
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaJS
> Affects Versions: Master, 3.1.0, 3.2.0, 3.3.0
> Reporter: Eric
> Labels: javascript
>
> When a script calls the cordova.raw.plugin('add', [..list of plugins...]) function, the promise that it returns does not properly wait for all of the plugins to complete their installation.
> This prevents a script from reliably installing the plugins and then proceeding to build the platforms, because the platforms may start building before the plugins have finished installing.
> I believe the issue is:
> https://github.com/apache/cordova-cli/blob/f338c0fc6f2ccc09b48001e96dd80d15757c8e83/src/platform.js#L256-262
> On L261, the value of f that is passed to the reduce function is undefined, where the code looks to be expecting a function.
> One solution could be to replace L256-262 with:
> {code:javascript}
> return Q.all(plugins.map(function(plugin) {
> events.emit('verbose', 'Installing plugin "' + plugin + '" following successful platform add of ' + target);
> return require('plugman').raw.install(target, output, path.basename(plugin), plugins_dir, {www_dir: parser.staging_dir()});
> }));
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)