You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2014/05/14 01:14:15 UTC

[jira] [Resolved] (CB-6655) Export plugin ID to hooks when adding plugins from Git repos

     [ https://issues.apache.org/jira/browse/CB-6655?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah resolved CB-6655.
----------------------------------

    Resolution: Fixed
      Assignee: Mark Koudritsky

> Export plugin ID to hooks when adding plugins from Git repos
> ------------------------------------------------------------
>
>                 Key: CB-6655
>                 URL: https://issues.apache.org/jira/browse/CB-6655
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugman
>    Affects Versions: 3.4.0
>         Environment: all environments
>            Reporter: Mike Cunneen
>            Assignee: Mark Koudritsky
>            Priority: Trivial
>              Labels: easyfix, features
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> An {{after_plugin_add}} hook script has access to the following environment variables (with example values):
> {quote}
>   CORDOVA_VERSION: '3.4.1-0.1.0',
>   CORDOVA_PLATFORMS: '',
>   CORDOVA_PLUGINS: 'https://github.com/cdibened/filechooser.git',
>   CORDOVA_HOOK: '.../myApp/hooks/after_plugin_add/my_hook_script.js',
>   CORDOVA_CMDLINE: 'node /usr/local/bin/cordova plugin add https://github.com/cdibened/filechooser.git'
> {quote}
> The problem is when adding a plugin from a remote git repo, there's no easy way of finding out WHICH plugin ID has just been added (which is quite essential for an after_plugin_add hook). The hook only has access to a Git URL.
> We should provide the plugin ID to the hook:
> {quote}
>   CORDOVA_PLUGIN_ID: 'com.cesidiodibenedetto.filechooser'
> {quote}
> We can provide this information from {{cordova-lib/src/plugman/util/plugins.js}}, as a simple process.env export. There are probably more elegant ways, but this would be a good start. 



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