feat: Only add directories in the packs folder not extra files
parent
7b51cb3201
commit
27d4d3508e
|
@ -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))
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue