mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: await importDirectory call (#2770)
await importDirectory to ensure all recursive calls inside the function are completed before calling fileLoader
This commit is contained in:
@@ -55,12 +55,11 @@ export async function fastFileLoader(
|
||||
before?: (uniqueFilePathCounter: number, paths: string[]) => void,
|
||||
) {
|
||||
await Promise.all(
|
||||
[...paths].map((path) => {
|
||||
[...paths].map(async (path) => {
|
||||
if (between) between(path, uniqueFilePathCounter, paths);
|
||||
importDirectory(path);
|
||||
await importDirectory(path);
|
||||
}),
|
||||
);
|
||||
|
||||
if (before) before(uniqueFilePathCounter, paths);
|
||||
|
||||
await fileLoader();
|
||||
|
||||
Reference in New Issue
Block a user