mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 05:24:55 +03:00
feat: remove launch options temporarily
This commit is contained in:
parent
720a7aa2a0
commit
16b50fc22b
@ -1,9 +0,0 @@
|
||||
export const parseLaunchOptions = (params: string | null): string[] => {
|
||||
if (params == null || params == "") {
|
||||
return [];
|
||||
}
|
||||
|
||||
const paramsSplit = params.split(" ");
|
||||
|
||||
return paramsSplit;
|
||||
};
|
@ -2,9 +2,7 @@ import { gameRepository } from "@main/repository";
|
||||
|
||||
import { registerEvent } from "../register-event";
|
||||
import { shell } from "electron";
|
||||
import { spawn } from "child_process";
|
||||
import { parseExecutablePath } from "../helpers/parse-executable-path";
|
||||
import { parseLaunchOptions } from "../helpers/parse-launch-options";
|
||||
|
||||
const openGame = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
@ -12,24 +10,15 @@ const openGame = async (
|
||||
executablePath: string,
|
||||
launchOptions: string | null
|
||||
) => {
|
||||
// TODO: revisit this for launchOptions
|
||||
const parsedPath = parseExecutablePath(executablePath);
|
||||
const parsedParams = parseLaunchOptions(launchOptions);
|
||||
|
||||
await gameRepository.update(
|
||||
{ id: gameId },
|
||||
{ executablePath: parsedPath, launchOptions }
|
||||
);
|
||||
|
||||
if (
|
||||
process.platform === "linux" ||
|
||||
process.platform === "darwin" ||
|
||||
parsedParams.length === 0
|
||||
) {
|
||||
shell.openPath(parsedPath);
|
||||
return;
|
||||
}
|
||||
|
||||
spawn(parsedPath, parsedParams, { shell: false, detached: true });
|
||||
shell.openPath(parsedPath);
|
||||
};
|
||||
|
||||
registerEvent("openGame", openGame);
|
||||
|
@ -141,8 +141,7 @@ export function GameOptionsModal({
|
||||
const shouldShowWinePrefixConfiguration =
|
||||
window.electron.platform === "linux";
|
||||
|
||||
const shouldShowLaunchOptionsConfiguration =
|
||||
window.electron.platform === "win32";
|
||||
const shouldShowLaunchOptionsConfiguration = false;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user