feat: using showItemInFolder to open exe and download paths

This commit is contained in:
Zamitto 2024-06-07 14:03:57 -03:00
parent cead92d900
commit 08eda5573d
7 changed files with 28 additions and 21 deletions

View file

@ -1,5 +1,4 @@
import { shell } from "electron";
import path from "node:path";
import { gameRepository } from "@main/repository";
import { registerEvent } from "../register-event";
@ -11,12 +10,9 @@ const openGameExecutablePath = async (
where: { id: gameId, isDeleted: false },
});
if (!game || !game.executablePath) return true;
if (!game || !game.executablePath) return;
const gamePath = path.join(game.executablePath, "../");
shell.openPath(gamePath);
return true;
shell.showItemInFolder(game.executablePath);
};
registerEvent("openGameExecutablePath", openGameExecutablePath);