INNER CODE UNIT · TypeScript

main

cyanheads/pubmed-mcp-server · scripts/build-changelog.ts:206

function main(): void {
  const checkOnly = process.argv.includes('--check');

  if (!existsSync(CHANGELOG_DIR)) {
    console.log(`Skipped: ${CHANGELOG_DIR} does not exist (single-file CHANGELOG.md project).`);
    process.exit(0);
  }

  // A fresh scaffold ships `changelog/template.md` (excluded) and no `<major.minor>.x/`
  // version files yet, so `changelog/` exists but `buildRollup()` would throw. Under
  // --check, that's not drift — skip cleanly. A manual `changelog:build` still throws,
  // surfacing the empty-tree mistake when someone explicitly regenerates.
  if (checkOnly && collectVersionFiles().length === 0) {
    console.log(`Skipped: no per-version changelog files under ${CHANGELOG_DIR}/<major.minor>.x/.`);
    process.exit(0);
  }

  const { content: generated, missingSummary } = buildRollup();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…