cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Grieve (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-5674) Installing plugins programatically using the cordova cli npm module fails due to promise issue
Date Thu, 19 Dec 2013 15:52:10 GMT

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

Andrew Grieve commented on CB-5674:
-----------------------------------

Also note - repro steps were to create a project with multiple plugins, then:
{code}
  platform rm ios
  platform add ios
{code}

> 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
>            Assignee: Andrew Grieve
>              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)

Mime
View raw message