maybe
This commit is contained in:
parent
30cce5845c
commit
4745fb5145
@ -30,11 +30,11 @@ export class CommandRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async loadCommandFile(file: fs.Dirent): Promise<void> {
|
private async loadCommandFile(file: fs.Dirent): Promise<void> {
|
||||||
const fullPath = getAppPath('commands', file.name)
|
|
||||||
const commandName = path.basename(file.name, path.extname(file.name))
|
|
||||||
|
|
||||||
try {
|
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') {
|
if (typeof module.default !== 'function') {
|
||||||
this.logger.warn(`Unrecognized export in ${file.name}`)
|
this.logger.warn(`Unrecognized export in ${file.name}`)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user