less finicky import modules

This commit is contained in:
Dinhero21 2024-09-12 23:50:44 -03:00
parent abb3721b6d
commit c7fa5a4b1d

View file

@ -25,12 +25,9 @@ export async function* importModulesGenerator(
callbacks?: Callbacks,
): AsyncGenerator<unknown> {
for (const entry of await readdir(directory, { withFileTypes: true })) {
const path = resolve(entry.path, entry.name, index);
const path = resolve(entry.parentPath, entry.name, index);
if (!entry.isDirectory())
console.warn(
`Expected ${entry.name} to be a directory (located at ${entry.path})`,
);
if (!entry.isDirectory()) continue;
if (!(await exists(path))) continue;