From ba0ceda03a030f800172261ea95016a24450e5d1 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Sun, 29 Dec 2024 01:30:06 +0100 Subject: [PATCH] Maybe 2 --- src/application/console/commandRegistry.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/application/console/commandRegistry.ts b/src/application/console/commandRegistry.ts index 127dda4..0925734 100644 --- a/src/application/console/commandRegistry.ts +++ b/src/application/console/commandRegistry.ts @@ -1,5 +1,6 @@ import * as fs from 'fs' import * as path from 'path' +import { pathToFileURL } from 'url' import Logger, { LoggerType } from '#application/logger' import { getAppPath } from '#application/storage' @@ -34,7 +35,7 @@ export class CommandRegistry { const filePath = getAppPath('commands', file.name) const commandName = path.basename(file.name, path.extname(file.name)) - const module = await import(filePath) + const module = await import(pathToFileURL(filePath).href) if (typeof module.default !== 'function') { this.logger.warn(`Unrecognized export in ${file.name}`) return