From 63f97da25bf716979699fa4789068bf7a4a75b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20von=20der=20Gr=C3=BCn?= Date: Sun, 10 Nov 2019 16:18:05 +0100 Subject: [PATCH] refactor: Remove support for /.cordova/config.json (#475) BREAKING CHANGE: removes fourth argument `config` from `cordova create`. --- doc/create.txt | 6 ++---- src/cli.js | 10 ++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/doc/create.txt b/doc/create.txt index f83e0f560..101303484 100644 --- a/doc/create.txt +++ b/doc/create.txt @@ -1,19 +1,17 @@ Synopsis - cordova-cli create [ID [NAME [CONFIG]]] [options] + cordova-cli create [ID [NAME]] [options] Create a Cordova project PATH ......................... Where to create the project ID ........................... Reverse-domain-style package name - used in NAME ......................... Human readable name - CONFIG ....................... json string whose key/values will be included in - [PATH]/.cordova-cli/config.json Options --template= ... use a custom template located locally, in NPM, or GitHub. --link-to= ........................ 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 520520ae8..aec20818f 100644 --- a/src/cli.js +++ b/src/cli.js @@ -484,9 +484,8 @@ function cli (inputArgs) { } } -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 @@ function create ([_, dir, id, name, cfgJson], args) { 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); }