Skip to content

Commit

Permalink
refactor: Remove support for <project>/.cordova/config.json (#475)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removes fourth argument `config` from `cordova create`.
  • Loading branch information
raphinesse authored Nov 10, 2019
1 parent 05547bb commit 63f97da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions doc/create.txt
Original file line number Diff line number Diff line change
@@ -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
10 changes: 4 additions & 6 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

0 comments on commit 63f97da

Please # to comment.