From 95a0d55426d47e6ed6c26ecf945f3893ef4d91e6 Mon Sep 17 00:00:00 2001 From: Daniel Freitas Date: Fri, 31 May 2024 14:45:26 -0300 Subject: [PATCH] feat: look for a single alternative setup when installing --- src/main/events/library/open-game-installer.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/events/library/open-game-installer.ts b/src/main/events/library/open-game-installer.ts index 0b7e98db..5a3295eb 100644 --- a/src/main/events/library/open-game-installer.ts +++ b/src/main/events/library/open-game-installer.ts @@ -54,12 +54,14 @@ const openGameInstaller = async ( } const gamePathFileNames = fs.readdirSync(gamePath); - const gameAlternativeSetupPath = gamePathFileNames.find( + const gamePathExecutableFiles = gamePathFileNames.filter( (fileName: string) => path.extname(fileName).toLowerCase() === ".exe" ); - if (gameAlternativeSetupPath) { - return executeGameInstaller(path.join(gamePath, gameAlternativeSetupPath)); + if (gamePathExecutableFiles.length === 1) { + return executeGameInstaller( + path.join(gamePath, gamePathExecutableFiles[0]) + ); } if (spawnSync("which", ["lutris"]).status === 0) {