Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2727511DA8 for ; Tue, 13 May 2014 12:15:12 +0000 (UTC) Received: (qmail 7146 invoked by uid 500); 10 May 2014 22:06:23 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 6962 invoked by uid 500); 10 May 2014 22:06:23 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 6773 invoked by uid 99); 10 May 2014 22:06:23 -0000 Received: from Unknown (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 May 2014 22:06:23 +0000 Date: Sat, 10 May 2014 22:06:23 +0000 (UTC) From: "Mike Cunneen (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-6655) Export plugin ID to hooks when adding plugins from Git repos MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)