docs: proceed when version folder doesn't exist

A version folder may not exists (for example, when adding a new
version). Proceed!
This commit is contained in:
Edward Thomson
2026-05-04 23:24:33 +01:00
parent cf028e7e9a
commit eb0f7a734e

View File

@@ -1087,6 +1087,13 @@ async function produceDocumentationMetadata(version, apiData) {
async function cleanupOldDocumentation(version) { async function cleanupOldDocumentation(version) {
const versionDir = `${outputPath}/${version}`; const versionDir = `${outputPath}/${version}`;
try {
await fs.stat(versionDir);
}
catch (err) {
return;
}
for (const fn of await fs.readdir(versionDir)) { for (const fn of await fs.readdir(versionDir)) {
if (fn === '.metadata') { if (fn === '.metadata') {
continue; continue;