From 9602ffbd20307a9619cfd90fa7c4a4baa7430b5e Mon Sep 17 00:00:00 2001 From: Fhilipe Coelho Date: Thu, 11 Apr 2024 14:39:40 -0300 Subject: [PATCH] refactor: use args array in spawn function --- src/main/events/library/open-game.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/events/library/open-game.ts b/src/main/events/library/open-game.ts index 2c9b804d..ab987ae7 100644 --- a/src/main/events/library/open-game.ts +++ b/src/main/events/library/open-game.ts @@ -32,14 +32,19 @@ const openGame = async ( if (spawnSync('which', ['lutris']).status === 0) { const ymlPath = path.join(gamePath, "setup.yml"); await writeFile(ymlPath, generateYML(game)); - const subprocess = spawn(`lutris --install '${ymlPath}'`, { + const lutris = spawn('lutris', ['--install', `'${ymlPath}'`], { shell: true, detached: true, stdio: 'ignore' }); - subprocess.unref(); + lutris.unref(); } else { - spawn(`wine '${setupPath}'`, { shell: true }); + const wine = spawn('wine', [`'${setupPath}'`], { + shell: true, + detached: true, + stdio: 'ignore' + }); + wine.unref(); } } } else {