( source: string, outputFile: string, )
| 689 | } |
| 690 | |
| 691 | export async function exportHandler( |
| 692 | source: string, |
| 693 | outputFile: string, |
| 694 | ): Promise<void> { |
| 695 | try { |
| 696 | const log = await resolveLogSource(source) |
| 697 | const outputPath = expandPath(outputFile) |
| 698 | const rendered = await renderLog(log) |
| 699 | |
| 700 | await mkdir(dirname(outputPath), { recursive: true }) |
| 701 | await writeFile(outputPath, rendered, 'utf8') |
| 702 | writeToStdout(`Conversation exported to ${outputPath}\n`) |
| 703 | await gracefulShutdown(0) |
| 704 | } catch (error) { |
| 705 | writeToStderr(`Failed to export conversation: ${errorMessage(error)}\n`) |
| 706 | await gracefulShutdown(1) |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | export async function taskCreateHandler( |
| 711 | subject: string, |
no test coverage detected