From 20faf36b372317da8d58c8888603b626d907266b Mon Sep 17 00:00:00 2001 From: Fazri Gading Date: Mon, 26 Jan 2026 12:01:46 +0800 Subject: [PATCH] fix: remove broken symlink after detected --- backend/core/paths.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/core/paths.js b/backend/core/paths.js index b6aa309..147bc46 100644 --- a/backend/core/paths.js +++ b/backend/core/paths.js @@ -187,9 +187,10 @@ async function getModsPath(customInstallPath = null) { } catch (e) { /* ignore */ } if (!isBrokenLink) { - // Ensure the Mods directory exists - fs.mkdirSync(modsPath, { recursive: true }); + fs.unlinkSync(modsPath); // Remove broken symlink } + // Ensure the Mods directory exists + fs.mkdirSync(modsPath, { recursive: true }); } if (!fs.existsSync(disabledModsPath)) { fs.mkdirSync(disabledModsPath, { recursive: true });