From 483d7bd99a2bd680778c8af8e621cbf12cf21a07 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 7 Jan 2022 17:50:00 +0200 Subject: [PATCH] Made DXVK logs deletion option works --- src/index.svelte | 2 +- src/ts/launcher/states/Launch.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/index.svelte b/src/index.svelte index 22b30d9..8ef419b 100644 --- a/src/index.svelte +++ b/src/index.svelte @@ -57,7 +57,7 @@ await launcher.rpc.stop(true); // Remove .tmp files from the temp folder - await Neutralino.os.execCommand(`rm -f "${Process.addSlashes(`${tempDir}/*.tmp`)}"`); + await Neutralino.os.execCommand(`find "${Process.addSlashes(tempDir)}" -maxdepth 1 -type f -name "*.tmp" -delete`); // Save logs const log = Debug.get().join("\r\n"); diff --git a/src/ts/launcher/states/Launch.ts b/src/ts/launcher/states/Launch.ts index f6e66ba..2db5173 100644 --- a/src/ts/launcher/states/Launch.ts +++ b/src/ts/launcher/states/Launch.ts @@ -184,6 +184,20 @@ export default (launcher: Launcher): Promise => { launcher.updateDiscordRPC('in-launcher'); launcher.tray.hide(); + // Purge DXVK logs + Configs.get('purge_dxvk_logs').then(async (purge_logs) => { + if (purge_logs) + { + const gameDir = Process.addSlashes(await constants.paths.gameDir); + + // Delete .log files (e.g. "ZFGameBrowser_xxxx.log") + Neutralino.os.execCommand(`find "${gameDir}" -maxdepth 1 -type f -name "*.log" -delete`); + + // Delete .dmp files (e.g. "DumpFile-zfbrowser-xxxxxx.dmp") + Neutralino.os.execCommand(`find "${gameDir}" -maxdepth 1 -type f -name "*.dmp" -delete`); + } + }); + // TODO resolve();