fix: added detached to the spawn to fix the game closing with the launcher

This commit is contained in:
Davi Souto 2024-12-26 22:17:22 -03:00
parent e1904b853e
commit c098d8ffcf

View File

@ -15,14 +15,17 @@ const openGame = async (
const parsedPath = parseExecutablePath(executablePath);
const parsedParams = parseLaunchOptions(launchOptions);
await gameRepository.update({ id: gameId }, { executablePath: parsedPath, launchOptions });
await gameRepository.update(
{ id: gameId },
{ executablePath: parsedPath, launchOptions }
);
if (process.platform === "linux" || process.platform === "darwin") {
shell.openPath(parsedPath);
}
if (process.platform === "win32") {
spawn(parsedPath, parsedParams, { shell: false });
spawn(parsedPath, parsedParams, { shell: false, detached: true });
}
};