Skip to content

Commit

Permalink
Merge pull request #187 from TomyBDev/master
Browse files Browse the repository at this point in the history
Fixes setting game folder on certain linux osu-winello configurations
  • Loading branch information
KotRikD committed Sep 15, 2024
2 parents 5f02524 + ce9863e commit ca78f44
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/tsprocess/src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ export class Process {
return pathDirname(ProcessUtils.getProcessPath(this.handle));
}

// If using osu-winello
if (
process.platform === 'linux' &&
this.getProcessPath().match('wine-preloader')
) {
return this.getProcessCommandLine()
.slice(2)
.replace(/\\/g, '/')
.replace(/\/osu!.exe$/, ''); // Format windows dir to linux style.
}

return this.getProcessCwd();
}

Expand All @@ -56,6 +67,10 @@ export class Process {
return ProcessUtils.getProcessCwd(this.handle);
}

getProcessPath(): string {
return ProcessUtils.getProcessPath(this.handle);
}

readByte(address: number): number {
return ProcessUtils.readByte(this.handle, address);
}
Expand Down

0 comments on commit ca78f44

Please sign in to comment.