You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2013/03/23 05:53:23 UTC

git commit: Updating docs for variables/preferences

Updated Branches:
  refs/heads/master ced6703a5 -> 00e769b5c


Updating docs for variables/preferences


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/00e769b5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/00e769b5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/00e769b5

Branch: refs/heads/master
Commit: 00e769b5c004aafa47ae9a35a0d19ee06975895a
Parents: ced6703
Author: Anis Kadri <an...@gmail.com>
Authored: Fri Mar 22 15:18:38 2013 -0700
Committer: Anis Kadri <an...@gmail.com>
Committed: Fri Mar 22 15:18:38 2013 -0700

----------------------------------------------------------------------
 README.md  |    8 ++++++++
 plugman.js |   18 +++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/00e769b5/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 942fcf4..8955f18 100644
--- a/README.md
+++ b/README.md
@@ -344,6 +344,14 @@ variable reference may be detected (in this case, from the `AndroidManifest.xml`
 file, or specified by the user of the tool; the exact process is dependent on
 the particular tool.
 
+plugman can request users to specify variables required by a plugin. For example API keys for C2M and Google Maps can be specified as a command line argument like so:
+
+    plugman --platform ios|android --project /path/to/project --plugin name|git-url|path --variable API_KEY="!@CFATGWE%^WGSFDGSDFW$%^#$%YTHGsdfhsfhyer56734"
+
+A preference tag will need to be present inside the platform tag to make the variable mandatory like so:
+
+    <preference name="API_KEY">
+
 Certain variable names should be reserved - these are listed below.
 
 ### $PACKAGE_NAME

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/00e769b5/plugman.js
----------------------------------------------------------------------
diff --git a/plugman.js b/plugman.js
index a38b76e..b81cedf 100755
--- a/plugman.js
+++ b/plugman.js
@@ -71,15 +71,15 @@ else if (cli_opts.remove) {
     handlePlugin('uninstall', cli_opts.platform, cli_opts.project, cli_opts.plugin);
 }
 else {
-    var cli_variables = {}
-	if (cli_opts.variable) {
-		cli_opts.variable.forEach(function (variable) {
-			var tokens = variable.split('=');
-			var key = tokens.shift().toUpperCase();
-			if (/^[\w-_]+$/.test(key)) cli_variables[key] = tokens.join('=');
-		});
-	}
-    handlePlugin('install', cli_opts.platform, cli_opts.project, cli_opts.plugin, cli_variables);
+  var cli_variables = {}
+  if (cli_opts.variable) {
+    cli_opts.variable.forEach(function (variable) {
+        var tokens = variable.split('=');
+        var key = tokens.shift().toUpperCase();
+        if (/^[\w-_]+$/.test(key)) cli_variables[key] = tokens.join('=');
+        });
+  }
+  handlePlugin('install', cli_opts.platform, cli_opts.project, cli_opts.plugin, cli_variables);
 }
 
 function printUsage() {