refactor: use args array in spawn function

This commit is contained in:
Fhilipe Coelho 2024-04-11 14:39:40 -03:00
parent 54e29c12d4
commit 9602ffbd20

View File

@ -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 {