1
0
forked from noxious/server

npm run dev

This commit is contained in:
2024-09-30 22:42:46 +02:00
parent 3638e2a793
commit 4f9a1bc879
6 changed files with 26 additions and 27 deletions

View File

@ -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()