mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: using showItemInFolder to open exe and download paths
This commit is contained in:
parent
cead92d900
commit
08eda5573d
7 changed files with 28 additions and 21 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue