(options: WeeklyOptions, docsUpdate: string)
| 267 | } |
| 268 | |
| 269 | function 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 | |
| 288 | function renderDocsUpdate( |
| 289 | options: WeeklyOptions, |
no test coverage detected