(commands: Command[], argv: string[], initOptions: InitConfig)
| 10 | |
| 11 | export type CliSession = Awaited<ReturnType<typeof init>>; |
| 12 | |
| 13 | export async function runSingleInvocation(commands: Command[], argv: string[], initOptions: InitConfig): Promise<void> { |
| 14 | try { |
| 15 | await runCommand(commands, argv, initOptions); |
| 16 | } catch (error: unknown) { |
| 17 | if (error instanceof ExitError) { |
| 18 | process.exit(2); |
| 19 | return; |
| 20 | } |
| 21 | if (isRecoverableReplError(error)) { |
| 22 | console.error(error instanceof Error ? error.message : String(error)); |
| 23 | process.exit(1); |
| 24 | return; |
| 25 | } |
| 26 | reportFatalError(error); |
| 27 | captureException(error); |
| 28 | await flushSentry(); |
| 29 | process.exit(1); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | export async function runCommand( |
no test coverage detected