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