Skip to content

Commit 54c7d55

Browse files
committed
feat(capacitor): prompt for supported platforms when adding
1 parent 20ec9e2 commit 54c7d55

File tree

1 file changed

+3
-4
lines changed
  • packages/ionic/src/commands/capacitor

1 file changed

+3
-4
lines changed

packages/ionic/src/commands/capacitor/add.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import chalk from 'chalk';
22

3-
import { validators } from '@ionic/cli-framework';
43
import { CommandInstanceInfo, CommandLineInputs, CommandLineOptions, CommandMetadata, CommandPreRun } from '@ionic/cli-utils';
54

65
import { CapacitorCommand } from './base';
@@ -25,10 +24,10 @@ ${chalk.green('ionic capacitor add')} will do the following:
2524

2625
if (inputs.length < 1) {
2726
const platform = await this.env.prompt({
28-
type: 'input',
27+
type: 'list',
2928
name: 'platform',
30-
message: `What platform would you like to add (${['android', 'ios', 'electron'].map(v => chalk.green(v)).join(', ')}):`,
31-
validate: v => validators.required(v),
29+
message: 'What platform would you like to add?',
30+
choices: ['android', 'ios', 'electron'],
3231
});
3332

3433
inputs[0] = platform.trim();

0 commit comments

Comments
 (0)