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

Stéphane Péchard commented on CB-6179:
--------------------------------------

Thanks for the answer. Running 'cordova plugin ls' was how I originally did in 
my hook, but for a strange reason, it works well with one platform added 
(either Android or iOS), but crashes if I add a second one. I receive a weird :

[STDERR] Error: ENOENT, no such file or directory 
'/.../Project/platforms/ios/.staging/www/cordova_plugins.js'

This after_prepare hook purpose is to remove/install the plugin I write, to 
test it rapidly while I code it.

> CORDOVA_PLUGINS environment variable empty in hook
> --------------------------------------------------
>
>                 Key: CB-6179
>                 URL: https://issues.apache.org/jira/browse/CB-6179
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 3.4.0
>         Environment: Mac OS X
>            Reporter: Stéphane Péchard
>              Labels: cordova-cli, hooks, plugin
>
> Here are the steps to reproduce the bug:
> cordova create Baz
> cd Baz
> mkdir hooks/before_prepare
> echo '#!/usr/bin/env node
> console.log("CORDOVA_PLUGINS: " + process.env.CORDOVA_PLUGINS);' > 
> hooks/before_prepare/1_env_plugins.js
> chmod +x hooks/before_prepare/1_env_plugins.js
> cordova platform add android
> cordova plugins add org.apache.cordova.network-information
> cordova plugins ls
> cordova prepare --verbose
> cordova plugins ls
> In a new project, with an Android platform (the same happens with iOS), if 
> you try to access the CORDOVA_PLUGINS environment variable as done in the 
> 1_env_plugins.js hook, it does contains the plugins list as the command 
> 'cordova plugins ls'  does.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to