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