Mike Cunneen created CB-6655:
--------------------------------

             Summary: 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


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)

Reply via email to