fix(bots/discord): wrong command file path being imported

This commit is contained in:
PalmDevs
2024-06-23 14:01:06 +07:00
parent 348a18a401
commit fa0159c3a8

View File

@@ -5,7 +5,7 @@ import { fileURLToPath } from 'bun'
export const listAllFilesRecursive = (dir: string): string[] =>
readdirSync(dir, { recursive: true, withFileTypes: true })
.filter(x => x.isFile())
.map(x => join(dir, x.name))
.map(x => join(x.parentPath, x.name))
export const pathJoinCurrentDir = (importMetaUrl: string, ...objects: [string, ...string[]]) =>
join(dirname(fileURLToPath(importMetaUrl)), ...objects)