feat: Only add directories in the packs folder not extra files

master
ogomez-at-wiris 2022-02-25 02:29:46 +01:00
parent 7b51cb3201
commit 27d4d3508e
1 changed files with 4 additions and 2 deletions

View File

@ -13,9 +13,11 @@ export default class PackService {
public static getPackList = (): Array<Pack> => this.packList; public static getPackList = (): Array<Pack> => this.packList;
public static getInitialList = async (): Promise<void> => { public static getInitialList = async (): Promise<void> => {
let packs = await fs.readdirSync(PACK_BASE_PATH); let packs = await fs.readdirSync(PACK_BASE_PATH, { withFileTypes: true });
packs = packs.filter((pack) => pack.isDirectory());
PackService.packList = await Promise.all( PackService.packList = await Promise.all(
packs.map((pack) => PackService.getPackInfo(pack)) packs.map((pack) => PackService.getPackInfo(pack.name))
); );
}; };