Skip to content

Commit

Permalink
feat(cli): make init use values from capacitor.config.json as defaults (
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Mar 23, 2020
1 parent 23b2173 commit 9157e1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export async function getName(config: Config, name: string) {
const answers = await inquirer.prompt([{
type: 'input',
name: 'name',
default: 'App',
default: config.app.appName ? config.app.appName : 'App',
message: `App name`
}]);
return answers.name;
Expand All @@ -314,7 +314,7 @@ export async function getAppId(config: Config, id: string) {
const answers = await inquirer.prompt([{
type: 'input',
name: 'id',
default: 'com.example.app',
default: config.app.appId ? config.app.appId : 'com.example.app',
message: 'App Package ID (in Java package format, no dashes)'
}]);
return answers.id;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function run(process: NodeJS.Process, cliBinDir: string) {
program
.command('init [appName] [appId]')
.description('Initializes a new Capacitor project in the current directory')
.option('--web-dir [value]', 'Optional: Directory of your projects built web assets', 'www')
.option('--web-dir [value]', 'Optional: Directory of your projects built web assets', config.app.webDir ? config.app.webDir : 'www')
.option('--npm-client [npmClient]', 'Optional: npm client to use for dependency installation')
.action((appName, appId, { webDir, npmClient }) => {
return initCommand(config, appName, appId, webDir, npmClient);
Expand Down

0 comments on commit 9157e1f

Please sign in to comment.