From fe55f9b9e6d4a91f44ad0d62fa139e110f96bda7 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Thu, 24 Oct 2024 17:42:46 +0200 Subject: [PATCH] chore: revert incorrectly removed code block --- docs-hub/vp-docs.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs-hub/vp-docs.js b/docs-hub/vp-docs.js index bd83b2e..c0b9832 100644 --- a/docs-hub/vp-docs.js +++ b/docs-hub/vp-docs.js @@ -91,6 +91,27 @@ function checkForUnusedFiles(srcFolderPath, subfolders) { const folderPath = path.join(srcFolderPath, folder); const subfolderNames = fs.readdirSync(folderPath); const parentFolder = folderPath.split("/").pop(); + subfolderNames.forEach((subFile) => { + const actualPath = `${parentFolder}/${ + subFile === "index.md" ? "" : subFile + }`; + assert( + configFile.includes(actualPath), + `${actualPath} missing in the nav config` + ); + const fullPath = path.join(srcFolderPath, actualPath); + if (fs.statSync(fullPath).isDirectory()) { + const subFolderFiles = fs.readdirSync(fullPath); + subFolderFiles.forEach((file) => { + if (file !== "index.md") { + assert( + configFile.includes(file.replace(".md", "")), + `${file} missing in the nav config` + ); + } + }); + } + }); }); }