1
0
forked from noxious/server

Windows fix

This commit is contained in:
Dennis Postma 2024-06-02 20:09:40 +02:00
parent e9d2eb905a
commit 1efeae5e55

View File

@ -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<string, Function> = 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);
}