forked from noxious/server
Windows fix
This commit is contained in:
parent
e9d2eb905a
commit
1efeae5e55
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user