mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 08:43:57 +00:00
19 lines
499 B
TypeScript
19 lines
499 B
TypeScript
import { shell } from "electron";
|
|
import { gameRepository } from "@main/repository";
|
|
import { registerEvent } from "../register-event";
|
|
|
|
const openGameExecutablePath = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
gameId: number
|
|
) => {
|
|
const game = await gameRepository.findOne({
|
|
where: { id: gameId, isDeleted: false },
|
|
});
|
|
|
|
if (!game || !game.executablePath) return;
|
|
|
|
shell.showItemInFolder(game.executablePath);
|
|
};
|
|
|
|
registerEvent("openGameExecutablePath", openGameExecutablePath);
|