Made DXVK logs deletion option works

This commit is contained in:
Observer KRypt0n_ 2022-01-07 17:50:00 +02:00
parent 3fa259ec64
commit 483d7bd99a
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
2 changed files with 15 additions and 1 deletions

View file

@ -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");

View file

@ -184,6 +184,20 @@ export default (launcher: Launcher): Promise<void> => {
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();