mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: make it possible to select shortcuts (.lnk)
This commit is contained in:
parent
82f72071f9
commit
7be626b3dd
5 changed files with 27 additions and 5 deletions
|
@ -2,15 +2,18 @@ import { gameRepository } from "@main/repository";
|
|||
|
||||
import { registerEvent } from "../register-event";
|
||||
import { shell } from "electron";
|
||||
import { parseExecutablePath } from "../helpers/parse-executable-path";
|
||||
|
||||
const openGame = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
gameId: number,
|
||||
executablePath: string
|
||||
) => {
|
||||
await gameRepository.update({ id: gameId }, { executablePath });
|
||||
const parsedPath = parseExecutablePath(executablePath);
|
||||
|
||||
shell.openPath(executablePath);
|
||||
await gameRepository.update({ id: gameId }, { executablePath: parsedPath });
|
||||
|
||||
shell.openPath(parsedPath);
|
||||
};
|
||||
|
||||
registerEvent("openGame", openGame);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue