* Publish a minimal repro and return its public URL. Degrades gracefully: * on failure it returns undefined so the issue still opens without a link.
(dir: string)
| 67 | * on failure it returns undefined so the issue still opens without a link. |
| 68 | */ |
| 69 | async function publishRepro(dir: string): Promise<string | undefined> { |
| 70 | const spinner = clack.spinner(); |
| 71 | spinner.start("Publishing minimal repro..."); |
| 72 | try { |
| 73 | const published = await publishProjectArchive(dir); |
| 74 | spinner.stop(c.success("Repro published")); |
| 75 | return published.url; |
| 76 | } catch (err: unknown) { |
| 77 | spinner.stop(c.error("Publish failed")); |
| 78 | console.error(` ${(err as Error).message}`); |
| 79 | console.log(` ${c.dim("Filing the issue without a repro link.")}`); |
| 80 | return undefined; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | async function openAndPrintIssue(url: string): Promise<void> { |
| 85 | if (process.stdout.isTTY) { |
no test coverage detected