From 8a8856772e8b282fd5eee0899e7c2a33bbd29a88 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Tue, 23 Apr 2024 08:55:00 +0200 Subject: [PATCH] assurance check, that the launcher does not delete stuff directly in the osu folder --- electron/osuUtil.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/electron/osuUtil.js b/electron/osuUtil.js index 170d194..aedee7a 100644 --- a/electron/osuUtil.js +++ b/electron/osuUtil.js @@ -277,6 +277,10 @@ async function downloadEZPPLauncherUpdateFiles(osuPath, updateFiles) { for (const files of await fs.promises.readdir(pruneFolder)) { const filePath = path.join(pruneFolder, files); if (!updateFiles.some(file => path.join(osuPath, ...file.folder.split("/"), file.name) === filePath)) { + //NOTE: check if the file is in the main osuPath folder, then dont delete. + if (path.dirname(filePath) == "osu!") + continue; + await fs.promises.rm(filePath, { recursive: true, force: true }); } }