mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
18 lines
534 B
TypeScript
18 lines
534 B
TypeScript
import { shell } from "electron";
|
|
import { registerEvent } from "../register-event";
|
|
import { gamesSublevel, levelKeys } from "@main/level";
|
|
import { GameShop } from "@types";
|
|
|
|
const openGameExecutablePath = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
shop: GameShop,
|
|
objectId: string
|
|
) => {
|
|
const game = await gamesSublevel.get(levelKeys.game(shop, objectId));
|
|
|
|
if (!game || !game.executablePath) return;
|
|
|
|
shell.showItemInFolder(game.executablePath);
|
|
};
|
|
|
|
registerEvent("openGameExecutablePath", openGameExecutablePath);
|