refactor: Remove support for <project>/.cordova/config.json (#475)
BREAKING CHANGE: removes fourth argument `config` from `cordova create`.
diff --git a/doc/create.txt b/doc/create.txt
index f83e0f5..1013034 100644
--- a/doc/create.txt
+++ b/doc/create.txt
@@ -1,19 +1,17 @@
Synopsis
- cordova-cli create <PATH> [ID [NAME [CONFIG]]] [options]
+ cordova-cli create <PATH> [ID [NAME]] [options]
Create a Cordova project
PATH ......................... Where to create the project
ID ........................... Reverse-domain-style package name - used in <widget id>
NAME ......................... Human readable name
- CONFIG ....................... json string whose key/values will be included in
- [PATH]/.cordova-cli/config.json
Options
--template=<PATH|NPM PACKAGE|GIT URL> ... use a custom template located locally, in NPM, or GitHub.
--link-to=<PATH> ........................ symlink to custom www assets without creating a copy.
-
+
Example
cordova-cli create myapp com.mycompany.myteam.myapp MyApp
\ No newline at end of file
diff --git a/src/cli.js b/src/cli.js
index 520520a..aec2081 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -484,9 +484,8 @@
}
}
-function create ([_, dir, id, name, cfgJson], args) {
- // If we got a fourth parameter, consider it to be JSON to init the config.
- var cfg = JSON.parse(cfgJson || '{}');
+function create ([_, dir, id, name], args) {
+ var cfg = {};
// Template path
var customWww = args['link-to'] || args.template;
@@ -504,14 +503,13 @@
if (customWww.substr(0, 1) === '~') { customWww = path.join(process.env.HOME, customWww.substr(1)); }
// Template config
- var wwwCfg = {
+ cfg.lib = {};
+ cfg.lib.www = {
url: customWww,
template: 'template' in args,
link: 'link-to' in args
};
- cfg.lib = cfg.lib || {};
- cfg.lib.www = wwwCfg;
}
return cordova.create(dir, id, name, cfg, events || undefined);
}