@hyperneutrino/djs-lite 1.7.3 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +8 -10
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -231,19 +231,17 @@ async function importAll(
|
|
|
231
231
|
) {
|
|
232
232
|
const files = await fs.readdir(path.resolve(directory), { recursive, withFileTypes: true });
|
|
233
233
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (file.name.startsWith(".")) return;
|
|
234
|
+
for (const file of files) {
|
|
235
|
+
if (file.isDirectory()) continue;
|
|
236
|
+
if (file.name.startsWith(".")) continue;
|
|
238
237
|
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
const absolutePath = path.resolve(file.parentPath, file.name);
|
|
239
|
+
const relativePath = path.join(directory, path.relative(path.resolve(directory), absolutePath));
|
|
241
240
|
|
|
242
|
-
|
|
241
|
+
const { default: item } = await import(absolutePath);
|
|
243
242
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
);
|
|
243
|
+
await consumer({ file, relativePath, absolutePath, item });
|
|
244
|
+
}
|
|
247
245
|
}
|
|
248
246
|
|
|
249
247
|
async function loadSubcommands(directory: string) {
|