From 1efeae5e55c7ac4dd70a820cbe72e10cdccc9dab Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Sun, 2 Jun 2024 20:09:40 +0200 Subject: [PATCH] Windows fix --- src/app/CommandManager.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/CommandManager.ts b/src/app/CommandManager.ts index 5963584..2ff571b 100644 --- a/src/app/CommandManager.ts +++ b/src/app/CommandManager.ts @@ -2,6 +2,7 @@ import * as readline from 'readline'; import * as fs from 'fs'; import * as path from 'path'; import {Server} from "socket.io"; +import * as os from 'os'; class CommandManager { private commands: Map = new Map(); @@ -58,6 +59,10 @@ class CommandManager { const commandName = path.basename(file, ext); const commandPath = path.join(commandsDir, file); + if (os.platform() === 'win32') { + const commandPath = path.join(commandsDir, file).replace(/\\/g, '/'); + } + const module = await import(commandPath); this.registerCommand(commandName, module.default); }