Fixed plugins not loading on windows
This commit is contained in:
@@ -91,7 +91,12 @@ export class ODPlugin extends ODManagerData {
|
|||||||
async execute(debug:ODDebugger,force?:boolean): Promise<boolean> {
|
async execute(debug:ODDebugger,force?:boolean): Promise<boolean> {
|
||||||
if ((this.enabled && !this.crashed) || force){
|
if ((this.enabled && !this.crashed) || force){
|
||||||
try{
|
try{
|
||||||
await import(nodepath.join("../../../../plugins/",this.getStartFile()))
|
//rewrite the path to make it work on windows & unix based systems
|
||||||
|
const workingDir = process.cwd().replace(/C:\\/i,"/")
|
||||||
|
const workingPath = nodepath.join("./dist/plugins/",this.getStartFile())
|
||||||
|
const pluginPath = nodepath.join(workingDir,workingPath).split(nodepath.sep).join("/")
|
||||||
|
|
||||||
|
await import(pluginPath)
|
||||||
debug.console.log("Plugin \""+this.id.value+"\" loaded successfully!","plugin")
|
debug.console.log("Plugin \""+this.id.value+"\" loaded successfully!","plugin")
|
||||||
this.executed = true
|
this.executed = true
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user