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

Function prependDocsUpdate

scripts/draft-changelog.ts:478–494  ·  view source on GitHub ↗
(version: string, docsUpdate: string)

Source from the content-addressed store, hash-verified

476}
477
478function prependDocsUpdate(version: string, docsUpdate: string) {
479 const changelogPath = join(ROOT, "docs", "changelog.mdx");
480 const changelog = readFileSync(changelogPath, "utf-8");
481
482 if (changelog.includes(`label="HyperFrames v${version}"`)) {
483 console.log(`docs/changelog.mdx already has a v${version} entry; leaving it unchanged.`);
484 return;
485 }
486
487 if (!changelog.includes(DOCS_MARKER)) {
488 fail(`Could not find insertion marker in ${changelogPath}`);
489 }
490
491 const updated = changelog.replace(DOCS_MARKER, `${DOCS_MARKER}\n\n${docsUpdate}`);
492 writeFileSync(changelogPath, updated);
493 console.log(`Prepended v${version} to ${changelogPath}`);
494}
495
496if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
497 main();

Callers 1

outputDraftFunction · 0.70

Calls 1

failFunction · 0.70

Tested by

no test coverage detected