From 4745fb51457a65b303759e8f12646035fdf6f155 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Sun, 29 Dec 2024 01:26:24 +0100 Subject: [PATCH] maybe --- src/application/console/commandRegistry.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/application/console/commandRegistry.ts b/src/application/console/commandRegistry.ts index b5d99a4..127dda4 100644 --- a/src/application/console/commandRegistry.ts +++ b/src/application/console/commandRegistry.ts @@ -30,11 +30,11 @@ export class CommandRegistry { } private async loadCommandFile(file: fs.Dirent): Promise { - const fullPath = getAppPath('commands', file.name) - const commandName = path.basename(file.name, path.extname(file.name)) - try { - const module = await import(fullPath) + const filePath = getAppPath('commands', file.name) + const commandName = path.basename(file.name, path.extname(file.name)) + + const module = await import(filePath) if (typeof module.default !== 'function') { this.logger.warn(`Unrecognized export in ${file.name}`) return