(summary: FetchSummary)
| 756 | * Format fetch summary for display |
| 757 | */ |
| 758 | export function formatFetchSummary(summary: FetchSummary): string { |
| 759 | const lines: string[] = []; |
| 760 | |
| 761 | lines.push(`Fetched from ${summary.source}@${summary.ref}:`); |
| 762 | |
| 763 | for (const file of summary.files) { |
| 764 | const icon = file.status === "skipped" ? "-" : "\u2713"; |
| 765 | const statusText = |
| 766 | file.status === "created" |
| 767 | ? "(created)" |
| 768 | : file.status === "overwritten" |
| 769 | ? "(overwritten)" |
| 770 | : "(skipped - already exists)"; |
| 771 | lines.push(` ${icon} ${file.relativePath} ${statusText}`); |
| 772 | } |
| 773 | |
| 774 | const parts: string[] = []; |
| 775 | if (summary.created > 0) parts.push(`${summary.created} created`); |
| 776 | if (summary.overwritten > 0) parts.push(`${summary.overwritten} overwritten`); |
| 777 | if (summary.skipped > 0) parts.push(`${summary.skipped} skipped`); |
| 778 | |
| 779 | lines.push(""); |
| 780 | const summaryText = parts.length > 0 ? parts.join(", ") : "no files"; |
| 781 | lines.push(`Summary: ${summaryText}`); |
| 782 | |
| 783 | return lines.join("\n"); |
| 784 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…