MCPcopy
hub / github.com/MisterBooo/LeetCodeAnimation / appendSyncLog

Function appendSyncLog

tools/scripts/sync-algomooc-index.js:237–250  ·  view source on GitHub ↗
(report, source)

Source from the content-addressed store, hash-verified

235}
236
237function appendSyncLog(report, source) {
238 if (!report.added.length && !report.changed.length && !report.removed.length) return;
239
240 const date = new Date().toISOString().slice(0, 10);
241 const parts = [];
242 if (report.added.length) parts.push(`新增 ${report.added.map(itemLabel).join("、")}`);
243 if (report.changed.length) parts.push(`更新 ${report.changed.map(itemLabel).join("、")}`);
244 if (report.removed.length) parts.push(`移除 ${report.removed.map(itemLabel).join("、")}`);
245 const row = `| ${date} | 网站索引同步 | ${parts.join(";")}。来源:\`${path.relative(ROOT, source)}\` |\n`;
246 const current = readText(FILES.syncLog) || syncLogHeader();
247 const header = syncLogHeader();
248 const body = current.startsWith(header) ? current.slice(header.length) : current;
249 writeText(FILES.syncLog, `${header}${row}${body}`);
250}
251
252const previousManifest = readJsonFile(FILES.manifest, []);
253const manifest = renderOnly ? previousManifest : buildManifest();

Callers 1

Calls 4

readTextFunction · 0.85
syncLogHeaderFunction · 0.85
writeTextFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected