Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): make init use values from capacitor.config.json as defaults #2620

Merged
merged 2 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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