mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
fix: win32 path
This commit is contained in:
parent
d17abdcd11
commit
08d320ad1c
@ -75,7 +75,12 @@ const findGamePathByProcess = (
|
||||
|
||||
if (hasProcess) {
|
||||
for (const path of [...hasProcess]) {
|
||||
if (path.toLowerCase().endsWith(executable.name)) {
|
||||
const executableName =
|
||||
process.platform === "win32"
|
||||
? executable.name.replace("/", "\\")
|
||||
: executable.name;
|
||||
|
||||
if (path.toLowerCase().endsWith(executableName)) {
|
||||
gameRepository.update(
|
||||
{ objectID: id, shop: "steam" },
|
||||
{ executablePath: path }
|
||||
@ -105,7 +110,9 @@ const getSystemProcessMap = async () => {
|
||||
};
|
||||
|
||||
const getExecutable = (path: string) => {
|
||||
return path.slice(path.lastIndexOf("/") + 1);
|
||||
return path.slice(
|
||||
path.lastIndexOf(process.platform === "win32" ? "\\" : "/") + 1
|
||||
);
|
||||
};
|
||||
|
||||
export const watchProcesses = async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user