From 4aacdd1607b80ca73849496b86bd7d635196dc75 Mon Sep 17 00:00:00 2001 From: DJj123dj <80536295+DJj123dj@users.noreply.github.com> Date: Sun, 21 Sep 2025 20:31:47 +0200 Subject: [PATCH] fix: #122 improved windows OT plugin support Open Ticket instances with plugins are now also able to exist outside of the default C:\\ drive on windows. This has been fixed by searching for the plugins relative to the bot instead of using an absolute path. --- src/core/api/modules/plugin.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/api/modules/plugin.ts b/src/core/api/modules/plugin.ts index ff9d412..9a46320 100644 --- a/src/core/api/modules/plugin.ts +++ b/src/core/api/modules/plugin.ts @@ -146,11 +146,8 @@ export class ODPlugin extends ODManagerData { async execute(debug:ODDebugger,force?:boolean): Promise { if ((this.enabled && !this.crashed) || force){ try{ - //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("/") - + //import relative plugin directory path (works on windows & unix based systems) + const pluginPath = nodepath.join("../../../../plugins/",this.getStartFile()) await import(pluginPath) debug.console.log("Plugin \""+this.id.value+"\" loaded successfully!","plugin") this.executed = true