Skip to content

Commit

Permalink
feat: remove launch options temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
zamitto committed Jan 1, 2025
1 parent 720a7aa commit 16b50fc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
9 changes: 0 additions & 9 deletions src/main/events/helpers/parse-launch-options.ts

This file was deleted.

15 changes: 2 additions & 13 deletions src/main/events/library/open-game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,23 @@ 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,
gameId: number,
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);
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ export function GameOptionsModal({
const shouldShowWinePrefixConfiguration =
window.electron.platform === "linux";

const shouldShowLaunchOptionsConfiguration =
window.electron.platform === "win32";
const shouldShowLaunchOptionsConfiguration = false;

return (
<>
Expand Down

0 comments on commit 16b50fc

Please sign in to comment.