You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mm...@apache.org on 2015/03/03 23:42:49 UTC
cordova-cli git commit: Using new cordova-lib api
Repository: cordova-cli
Updated Branches:
refs/heads/copy-from-app-hello-world 4ed51ee66 -> 1d6d55475
Using new cordova-lib api
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/1d6d5547
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/1d6d5547
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/1d6d5547
Branch: refs/heads/copy-from-app-hello-world
Commit: 1d6d554756e32bce234e6e9674938ef461d2d7bf
Parents: 4ed51ee
Author: Michal Mocny <mm...@gmail.com>
Authored: Tue Mar 3 17:37:49 2015 -0500
Committer: Michal Mocny <mm...@gmail.com>
Committed: Tue Mar 3 17:37:49 2015 -0500
----------------------------------------------------------------------
src/cli.js | 11 +++++------
src/create.js | 13 ++++++-------
2 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/1d6d5547/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index a6cf586..de4ba23 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -270,12 +270,11 @@ function cli(inputArgs) {
}
cfg.lib = cfg.lib || {};
cfg.lib.www = wwwCfg;
- // create(dir, id, name, cfg)
- cordova.raw.create( undashed[1] // dir to create the project in
- , undashed[2] // App id
- , undashed[3] // App name
- , cfg
- ).done();
+
+ if (undashed[2]) cfg.id = undashed[2];
+ if (undashed[3]) cfg.name = undashed[3];
+
+ cordova.raw.create(undashed[1], cfg).done();
} else {
// platform/plugins add/rm [target(s)]
subcommand = undashed[1]; // sub-command like "add", "ls", "rm" etc.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/1d6d5547/src/create.js
----------------------------------------------------------------------
diff --git a/src/create.js b/src/create.js
index 6a509ce..a12db91 100644
--- a/src/create.js
+++ b/src/create.js
@@ -34,13 +34,12 @@ CordovaCliCreate.prototype.run = function (args, undashed) {
// parseConfig will determine if there's a valid config JSON string
cfg = this.parseConfig(undashed[4]);
-
- // create(dir, id, name, cfg)
- cordova.raw.create( undashed[1] // dir to create the project in
- , undashed[2] // App id
- , undashed[3] // App name
- , cfg
- ).done();
+ console.log(cfg);
+
+ if (undashed[2]) cfg.id = undashed[2];
+ if (undashed[3]) cfg.name = undashed[3];
+
+ cordova.raw.create(undashed[1], cfg).done();
};
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org