Skip to content

Commit

Permalink
ci: 原来是你小子
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela committed Apr 7, 2024
1 parent fd40007 commit d6914d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/generateGadgetsDefinition/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d6914d6

Please sign in to comment.