From 11bad3bb4a8ea75f90478996531832008eb40781 Mon Sep 17 00:00:00 2001 From: Kensaa Date: Tue, 17 Sep 2024 12:14:38 +0200 Subject: [PATCH] fixed the previous change that only worked when a file was updated and not deleted --- launcher/electron/electron.ts | 11 ++++++++++- launcher/package.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/launcher/electron/electron.ts b/launcher/electron/electron.ts index 9b31963..412ee52 100644 --- a/launcher/electron/electron.ts +++ b/launcher/electron/electron.ts @@ -540,7 +540,16 @@ async function launchGameRemote(args: StartArgs) { .filter(key => typeof localFolder[key] === 'string') .filter(key => !Object.keys(remoteFolder).includes(key)) for (const file of onlyLocalFile) { - fs.rmSync(path.join(folderPath, ...pathA, file), { + if ( + pathA[0] !== undefined && + FOLDER_HASH_UPDATE_SKIP.includes(pathA[0]) + ) { + // Used to skip certain forlders (like config) from being deleted because we don't really care about them being up to date + continue + } + const filepath = path.join(folderPath, ...pathA, file) + logger.info('Deleting file "%s"', filepath) + fs.rmSync(filepath, { recursive: true }) } diff --git a/launcher/package.json b/launcher/package.json index 0a85a4e..b741aeb 100644 --- a/launcher/package.json +++ b/launcher/package.json @@ -3,7 +3,7 @@ "description": "A Minecraft launcher with auto-update feature to facilitate playing modded minecraft", "author": "Kensa", "private": true, - "version": "3.3.2", + "version": "3.3.3", "license": "MIT", "main": "dist-electron/electron.js", "scripts": {