You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Mike Cunneen (JIRA)" <ji...@apache.org> on 2014/05/11 00:06:23 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=13992606#comment-13992606 ] 

Mike Cunneen commented on CB-6655:
----------------------------------

Pull Request:
[https://github.com/apache/cordova-lib/pull/1]

> 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
>            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)