MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / formatFetchSummary

Function formatFetchSummary

src/lib/fetch.ts:758–784  ·  view source on GitHub ↗
(summary: FetchSummary)

Source from the content-addressed store, hash-verified

756 * Format fetch summary for display
757 */
758export 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}

Callers 2

fetch.test.tsFile · 0.85
fetchCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…