cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Grieve (JIRA)" <>
Subject [jira] [Commented] (CB-6179) CORDOVA_PLUGINS environment variable empty in hook
Date Thu, 06 Mar 2014 14:44:43 GMT


Andrew Grieve commented on CB-6179:

Seems CORDOVA_PLUGINS is set only when running a command "cordova plugin ..." commands. 

Probably we should set this for prepare, or add a new variable ALL_PLUGINS that is always
set no matter what the hook.

For now, I think you could work around this by having your hook run cordova plugin ls.

> CORDOVA_PLUGINS environment variable empty in hook
> --------------------------------------------------
>                 Key: CB-6179
>                 URL:
>             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
> 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

View raw message