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/06 22:00:49 UTC
cordova-lib git commit: Add merges/ by default, now all tests pass
Repository: cordova-lib
Updated Branches:
refs/heads/copy-from-app-hello-world 59e470a7a -> 9ce5bc1ba
Add merges/ by default, now all tests pass
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/9ce5bc1b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/9ce5bc1b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/9ce5bc1b
Branch: refs/heads/copy-from-app-hello-world
Commit: 9ce5bc1baf463d40e166944d2242fb38954dff2e
Parents: 59e470a
Author: Michal Mocny <mm...@gmail.com>
Authored: Fri Mar 6 16:00:41 2015 -0500
Committer: Michal Mocny <mm...@gmail.com>
Committed: Fri Mar 6 16:00:41 2015 -0500
----------------------------------------------------------------------
cordova-lib/src/cordova/create.js | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9ce5bc1b/cordova-lib/src/cordova/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/create.js b/cordova-lib/src/cordova/create.js
index ae3f1ee..ac67a86 100644
--- a/cordova-lib/src/cordova/create.js
+++ b/cordova-lib/src/cordova/create.js
@@ -170,12 +170,18 @@ function create(dir, optionalId, optionalName, cfg) {
if (fs.existsSync(path.join(paths.root, 'config.xml'))) {
paths.configXml = path.join(paths.root, 'config.xml');
+ } else {
+ paths.configXml = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world', 'config.xml');
}
if (fs.existsSync(path.join(paths.root, 'merges'))) {
paths.merges = path.join(paths.root, 'merges');
+ } else {
+ // No merges by default
}
if (fs.existsSync(path.join(paths.root, 'hooks'))) {
paths.hooks = path.join(paths.root, 'hooks');
+ } else {
+ paths.hooks = path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world', 'hooks');
}
var dirAlreadyExisted = fs.existsSync(dir);
@@ -228,13 +234,8 @@ function create(dir, optionalId, optionalName, cfg) {
shell.mkdir(path.join(dir, 'platforms'));
shell.mkdir(path.join(dir, 'plugins'));
- // Add template config.xml for apps that are missing it
- var configPath = cordova_util.projectConfig(dir);
- if (!fs.existsSync(configPath)) {
- shell.cp(path.join(__dirname, '..', '..', 'node_modules', 'cordova-app-hello-world', 'config.xml'), configPath);
- }
-
// Write out id and name to config.xml
+ var configPath = cordova_util.projectConfig(dir);
var conf = new ConfigParser(configPath);
if (cfg.id) conf.setPackageName(cfg.id);
if (cfg.name) conf.setName(cfg.name);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org