diff --git a/src/app/CommandManager.ts b/src/app/CommandManager.ts index adc1ded..6925fd4 100644 --- a/src/app/CommandManager.ts +++ b/src/app/CommandManager.ts @@ -14,13 +14,15 @@ class CommandManager { input: process.stdin, output: process.stdout }); - - this.loadCommands(); } public async boot(io: Server) { + // Start the command manager this.io = io as Server; + await this.loadCommands(); console.log('[✅] Command manager loaded'); + + // Start the prompt await this.startPrompt(); } @@ -57,17 +59,9 @@ class CommandManager { for (const file of files) { const ext = path.extname(file); const commandName = path.basename(file, ext); - let commandPath = path.join(commandsDir, file); - - console.log(commandPath); - - if (os.platform() === 'win32') { - commandPath = path.join(commandsDir, file).replace(/\\/g, '/'); - } - - console.log(commandPath); - + const commandPath = path.join(commandsDir, file); const module = await import(commandPath); + this.registerCommand(commandName, module.default); } } catch (error: any) { diff --git a/src/app/commands/todo.txt b/src/app/commands/todo.txt deleted file mode 100644 index 128a830..0000000 --- a/src/app/commands/todo.txt +++ /dev/null @@ -1 +0,0 @@ -In this folder will come commands that can be used in the server console \ No newline at end of file