(config: Config)
| 38 | } |
| 39 | |
| 40 | export function runProgram(config: Config): void { |
| 41 | program.version(config.cli.package.version); |
| 42 | |
| 43 | program |
| 44 | .command('config', { hidden: true }) |
| 45 | .description(`print evaluated Capacitor config`) |
| 46 | .option('--json', 'Print in JSON format') |
| 47 | .action( |
| 48 | wrapAction(async ({ json }) => { |
| 49 | const { configCommand } = await import('./tasks/config'); |
| 50 | await configCommand(config, json); |
| 51 | }), |
| 52 | ); |
| 53 | |
| 54 | program |
| 55 | .command('create [directory] [name] [id]', { hidden: true }) |
| 56 | .description('Creates a new Capacitor project') |
| 57 | .action( |
| 58 | wrapAction(async () => { |
| 59 | const { createCommand } = await import('./tasks/create'); |
| 60 | await createCommand(); |
| 61 | }), |
| 62 | ); |
| 63 | |
| 64 | program |
| 65 | .command('init [appName] [appId]') |
| 66 | .description(`Initialize Capacitor configuration`) |
| 67 | .option('--web-dir <value>', 'Optional: Directory of your projects built web assets') |
| 68 | .option('--skip-appid-validation', 'Optional: Skip validating the app ID for iOS and Android compatibility') |
| 69 | .action( |
| 70 | wrapAction( |
| 71 | telemetryAction(config, async (appName, appId, { webDir, skipAppidValidation }) => { |
| 72 | const { initCommand } = await import('./tasks/init'); |
| 73 | await initCommand(config, appName, appId, webDir, skipAppidValidation); |
| 74 | }), |
| 75 | ), |
| 76 | ); |
| 77 | |
| 78 | program |
| 79 | .command('serve', { hidden: true }) |
| 80 | .description('Serves a Capacitor Progressive Web App in the browser') |
| 81 | .action( |
| 82 | wrapAction(async () => { |
| 83 | const { serveCommand } = await import('./tasks/serve'); |
| 84 | await serveCommand(); |
| 85 | }), |
| 86 | ); |
| 87 | |
| 88 | program |
| 89 | .command('sync [platform]') |
| 90 | .description(`${c.input('copy')} + ${c.input('update')}`) |
| 91 | .option('--deployment', 'Optional: if provided, pod install will use --deployment option') |
| 92 | .option( |
| 93 | '--inline', |
| 94 | 'Optional: if true, all source maps will be inlined for easier debugging on mobile devices', |
| 95 | false, |
| 96 | ) |
| 97 | .action( |
no test coverage detected