refactor: remove redundant plataform validation

This commit is contained in:
JackEnx 2024-12-16 16:37:50 -03:00
parent c2a52d3c18
commit e87f287476

View file

@ -67,12 +67,9 @@ const findGamePathByProcess = (
if (hasProcess) { if (hasProcess) {
for (const path of [...hasProcess]) { for (const path of [...hasProcess]) {
const executableName = if (
process.platform === "win32" path.toLowerCase().endsWith(executable.name.replace(/\//g, "\\"))
? executable.name.replace("/", "\\") ) {
: executable.name;
if (path.toLowerCase().endsWith(executableName)) {
gameRepository.update( gameRepository.update(
{ objectID: id, shop: "steam" }, { objectID: id, shop: "steam" },
{ executablePath: path } { executablePath: path }