forked from noxious/server
npm run dev
This commit is contained in:
@ -67,9 +67,15 @@ class CommandManager {
|
||||
|
||||
for (const file of files) {
|
||||
try {
|
||||
const extension = config.ENV === 'development' ? '.ts' : '.js'
|
||||
const extension = path.extname(file)
|
||||
const commandName = path.basename(file, extension)
|
||||
const commandPath = path.join(commandsDir, `${commandName}${extension}`)
|
||||
|
||||
let commandPath: string
|
||||
commandPath = path.join(commandsDir, `${commandName}.js`)
|
||||
|
||||
if (config.ENV === 'development') {
|
||||
commandPath = path.join(commandsDir, `${commandName}.ts`)
|
||||
}
|
||||
|
||||
if (!fs.existsSync(commandPath)) {
|
||||
commandLogger.warn(`Command file not found: ${commandPath}`)
|
||||
@ -104,4 +110,4 @@ class CommandManager {
|
||||
}
|
||||
}
|
||||
|
||||
export default new CommandManager()
|
||||
export default new CommandManager()
|
||||
|
Reference in New Issue
Block a user