From d6914d6483ba3e8681dd75c9778a585bbb9029d9 Mon Sep 17 00:00:00 2001 From: AnnAngela Date: Sun, 7 Apr 2024 16:29:09 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=8E=9F=E6=9D=A5=E6=98=AF=E4=BD=A0?= =?UTF-8?q?=E5=B0=8F=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/generateGadgetsDefinition/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generateGadgetsDefinition/index.js b/scripts/generateGadgetsDefinition/index.js index 3099f57f..49646687 100644 --- a/scripts/generateGadgetsDefinition/index.js +++ b/scripts/generateGadgetsDefinition/index.js @@ -16,7 +16,7 @@ startGroup("gadgetsDefinitionList:"); console.info(gadgetsDefinitionList); endGroup(); const gadgetDirents = await fs.promises.readdir(gadgetBaseRoot, { withFileTypes: true }); -const gadgetDirs = await Promise.all(gadgetDirents.filter((dirent) => dirent.isDirectory()).map(async ({ name: gadget }) => ({ gadget, files: (await fs.promises.readdir(path.join(gadgetBaseRoot, gadget))).filter((file) => [".js", ".css"].includes(path.extname(path.join(gadgetBaseRoot, gadget, file)))) }))); +const gadgetDirs = await Promise.all(gadgetDirents.filter((dirent) => dirent.isDirectory()).map(async ({ name: gadget }) => ({ gadget, files: (await fs.promises.readdir(path.join(gadgetBaseRoot, gadget))).filter((file) => [".js", ".css", ".json"].includes(path.extname(path.join(gadgetBaseRoot, gadget, file)))) }))); const gadgets = gadgetDirs.map(({ gadget }) => gadget); const gadgetFiles = gadgetDirs.flatMap(({ files: _files }) => _files); const duplicatedGadgetFiles = gadgetFiles.filter((file, index) => gadgetFiles.lastIndexOf(file) !== index);