(program: Command)
| 166 | * Creates the action handler for the `integrations pull` subcommand. |
| 167 | */ |
| 168 | export function createIntegrationsPullAction(program: Command): (options: IntegrationsPullOptions) => Promise<void> { |
| 169 | return async options => { |
| 170 | try { |
| 171 | await pullIntegrations(options) |
| 172 | } catch (error) { |
| 173 | const message = error instanceof Error ? error.message : String(error) |
| 174 | const exitCode = |
| 175 | error instanceof MissingTokenError || error instanceof ApiError ? ExitCode.InvalidUsage : ExitCode.Error |
| 176 | program.error(chalk.red(message), { exitCode }) |
| 177 | } |
| 178 | } |
| 179 | } |
no test coverage detected