MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / prependDocsUpdate

Function prependDocsUpdate

scripts/changelog-weekly.ts:269–286  ·  view source on GitHub ↗
(options: WeeklyOptions, docsUpdate: string)

Source from the content-addressed store, hash-verified

267}
268
269function prependDocsUpdate(options: WeeklyOptions, docsUpdate: string) {
270 const weeklyUpdatesPath = join(ROOT, "docs", "weekly-updates.mdx");
271 const weeklyUpdates = readFileSync(weeklyUpdatesPath, "utf-8");
272 const label = weeklyLabel(options.from);
273
274 if (weeklyUpdates.includes(`label="${label}"`)) {
275 console.log(`docs/weekly-updates.mdx already has ${label}; leaving it unchanged.`);
276 return;
277 }
278
279 if (!weeklyUpdates.includes(DOCS_MARKER)) {
280 fail(`Could not find insertion marker in ${weeklyUpdatesPath}`);
281 }
282
283 const updated = weeklyUpdates.replace(DOCS_MARKER, `${DOCS_MARKER}\n\n${docsUpdate}`);
284 writeFileSync(weeklyUpdatesPath, updated);
285 console.log(`Prepended ${label} to ${weeklyUpdatesPath}`);
286}
287
288function renderDocsUpdate(
289 options: WeeklyOptions,

Callers 1

outputWeeklyDraftFunction · 0.70

Calls 2

weeklyLabelFunction · 0.85
failFunction · 0.70

Tested by

no test coverage detected