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

git commit: CB-5248 Fix cordova create directory_name com.example.app AppName extra_arg

Updated Branches:
  refs/heads/master c38dd9d79 -> 649096728


CB-5248 Fix cordova create directory_name com.example.app AppName extra_arg

Follow up to CB-4748
* Treat string as fourth argument to `cordova create` as JSON
* Properly document arguments to `cordova create` in `cordova help`


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

Branch: refs/heads/master
Commit: 6490967289e5116b69ef33f1c0a81facdb92ac18
Parents: c38dd9d
Author: Josh Soref <js...@blackberry.com>
Authored: Mon Nov 4 14:29:25 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Dec 5 21:12:36 2013 -0500

----------------------------------------------------------------------
 doc/help.txt  | 7 +++++--
 src/create.js | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/64909672/doc/help.txt
----------------------------------------------------------------------
diff --git a/doc/help.txt b/doc/help.txt
index 6dce120..b11b5c6 100644
--- a/doc/help.txt
+++ b/doc/help.txt
@@ -4,8 +4,11 @@ Synopsis
 
 Global Commands
 
-    create <PATH> [ID] [NAME] ................ creates a cordova project in the specified PATH, with
-                                               optional NAME and ID (reverse-domain-style package name)
+    create <PATH> [ID [NAME [CONFIG]]] ....... creates a cordova project in the specified PATH, with
+                                               ID reverse-domain-style package name - used in <widget id>
+                                               NAME is a human readable field
+                                               CONFIG is a json string whose key/values will be included
+                                               in [PATH]/.codova/config.json
     help ..................................... shows this syntax summary
 
     info ..................................... print out useful information helpful for submitting bug

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/64909672/src/create.js
----------------------------------------------------------------------
diff --git a/src/create.js b/src/create.js
index 1266b18..961d787 100644
--- a/src/create.js
+++ b/src/create.js
@@ -44,6 +44,9 @@ module.exports = function create (dir, id, name, cfg) {
     }
 
     // Massage parameters
+    if (typeof cfg == 'string') {
+        cfg = JSON.parse(cfg);
+    }
     cfg = cfg || {};
     id = id || cfg.id || DEFAULT_ID;
     name = name || cfg.name || DEFAULT_NAME;