Skip to content

Commit 07a661e

Browse files
committed
refactor: simplify process killing with new nile version
1 parent f1714f4 commit 07a661e

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/backend/storeManagers/nile/games.ts

+3-16
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
changeGameInstallPath,
1515
installState,
1616
removeFromInstalledConfig,
17-
fetchFuelJSON,
1817
getInstallMetadata
1918
} from './library'
2019
import {
@@ -24,7 +23,7 @@ import {
2423
logInfo,
2524
logsDisabled
2625
} from 'backend/logger/logger'
27-
import { gamesConfigPath, isLinux, isWindows } from 'backend/constants'
26+
import { gamesConfigPath, isWindows } from 'backend/constants'
2827
import { GameConfig } from 'backend/game_config'
2928
import {
3029
createAbortController,
@@ -573,21 +572,9 @@ export async function forceUninstall(appName: string) {
573572
}
574573

575574
export async function stop(appName: string, stopWine?: boolean) {
576-
const pattern = isLinux ? appName : 'nile'
575+
const pattern = process.platform === 'linux' ? appName : 'nile'
577576
killPattern(pattern)
578-
// Try to find the .exe name to stop the game, if running
579-
const fuel = fetchFuelJSON(appName)
580-
if (fuel) {
581-
// Find the executable name in order to pkill it
582-
// Killing nile is not enough as it doesn't manage the games it launches
583-
const { Command: exeName } = fuel.Main
584-
// Remove `.exe` extension for Windows to be able to kill the process
585-
const processName =
586-
isWindows && exeName.endsWith('.exe') ? exeName.slice(0, -4) : exeName
587-
killPattern(processName)
588-
} else {
589-
logError(['Could not fetch `fuel.json` for', appName], LogPrefix.Nile)
590-
}
577+
591578
if (stopWine && !isNative()) {
592579
const gameSettings = await getSettings(appName)
593580
await shutdownWine(gameSettings)

0 commit comments

Comments
 (0)