(app: AppCommand)
| 93 | } |
| 94 | |
| 95 | async function runCommand(app: AppCommand) { |
| 96 | switch (app.task) { |
| 97 | case 'add': { |
| 98 | await runAddCommand(app); |
| 99 | return; |
| 100 | } |
| 101 | case 'build': { |
| 102 | await runBuildCommand(app); |
| 103 | return; |
| 104 | } |
| 105 | case 'help': { |
| 106 | printHelp(app); |
| 107 | return; |
| 108 | } |
| 109 | case 'new': { |
| 110 | await runNewCommand(app); |
| 111 | return; |
| 112 | } |
| 113 | case 'joke': { |
| 114 | await runJokeCommand(); |
| 115 | return; |
| 116 | } |
| 117 | case 'migrate-v2': { |
| 118 | await runV2Migration(app); |
| 119 | return; |
| 120 | } |
| 121 | case 'check-client': { |
| 122 | await runQwikClientCommand(app); |
| 123 | return; |
| 124 | } |
| 125 | case 'version': { |
| 126 | printVersion(); |
| 127 | return; |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | if (typeof app.task === 'string') { |
| 132 | console.log(red(`Unrecognized qwik command: ${app.task}`) + '\n'); |
| 133 | } |
| 134 | |
| 135 | await printHelp(app); |
| 136 | process.exit(1); |
| 137 | } |
| 138 | |
| 139 | async function printHelp(app: AppCommand) { |
| 140 | const pmRun = pmRunCmd(); |
no test coverage detected
searching dependent graphs…