From 42e3d55cf480ef2d6235a3785ea2ced6fad70ea6 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Wed, 20 May 2026 18:14:53 +0200 Subject: [PATCH] what the hell did i do? --- server/plugins.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/plugins.js b/server/plugins.js index ed9b077..7815102 100644 --- a/server/plugins.js +++ b/server/plugins.js @@ -23,14 +23,16 @@ function parsePluginConfig(filePath) { if (pluginConfig.frontEndPath) { const sourcePath = path.join(path.dirname(filePath), pluginConfig.frontEndPath); - const destinationDir = path.join(__dirname, '../web/js/plugins', path.dirname(pluginConfig.frontEndPath)); - - // Check if the source path exists const destinationDir = path.join( __dirname, '../web/js/plugins', path.relative(pluginsDir, path.dirname(sourcePath)) ); + // Check if the source path exists + if (!fs.existsSync(sourcePath)) { + console.error(`Error: source path ${sourcePath} does not exist.`); + return pluginConfig; + } // Check if the destination directory exists, if not, create it if (!fs.existsSync(destinationDir)) fs.mkdirSync(destinationDir, { recursive: true }); // Create directory recursively