MCPcopy
hub / github.com/ionic-team/capacitor / runProgram

Function runProgram

cli/src/index.ts:40–430  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

38}
39
40export 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(

Callers 1

runFunction · 0.85

Calls 15

wrapActionFunction · 0.90
telemetryActionFunction · 0.90
fatalFunction · 0.90
configCommandFunction · 0.85
createCommandFunction · 0.85
initCommandFunction · 0.85
serveCommandFunction · 0.85
syncCommandFunction · 0.85
updateCommandFunction · 0.85
copyCommandFunction · 0.85
buildCommandFunction · 0.85
openCommandFunction · 0.85

Tested by

no test coverage detected