Skip to content

Commit bb314da

Browse files
committed
Allow new articles in bundle validation
1 parent f57c47e commit bb314da

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/validate-article-bundles.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ for (const year of readdirSync(contentRoot, { withFileTypes: true }).filter((ent
8787
if (!existsSync(join(contentRoot, year.name, '_index.md'))) fail(`Year branch is missing _index.md: ${year.name}`);
8888
else checkOutput(yearRoute, `Year archive ${year.name}`);
8989
const yearHtml = archiveHtml(yearRoute);
90-
for (const [route, source] of sourceArticles) if (source.year === year.name && !inventoryByRoute.get(route).draft && !includesRoute(yearHtml, route)) fail(`Article is missing from its year archive: ${route}`);
90+
for (const [route, source] of sourceArticles) if (source.year === year.name && !inventoryByRoute.get(route)?.draft && !includesRoute(yearHtml, route)) fail(`Article is missing from its year archive: ${route}`);
9191
for (const month of readdirSync(join(contentRoot, year.name), { withFileTypes: true }).filter((entry) => entry.isDirectory())) {
9292
const monthRoute = `${yearRoute}${month.name}/`;
9393
if (!existsSync(join(contentRoot, year.name, month.name, '_index.md'))) fail(`Month branch is missing _index.md: ${year.name}/${month.name}`);
9494
else checkOutput(monthRoute, `Month archive ${year.name}/${month.name}`);
9595
const monthHtml = archiveHtml(monthRoute);
96-
for (const [route, source] of sourceArticles) if (source.year === year.name && source.month === month.name && !inventoryByRoute.get(route).draft && !includesRoute(monthHtml, route)) fail(`Article is missing from its month archive: ${route}`);
96+
for (const [route, source] of sourceArticles) if (source.year === year.name && source.month === month.name && !inventoryByRoute.get(route)?.draft && !includesRoute(monthHtml, route)) fail(`Article is missing from its month archive: ${route}`);
9797
}
9898
}
9999

0 commit comments

Comments
 (0)