Skip to content

Commit 6df8481

Browse files
authored
Merge pull request #60 from realytcracker/patch-1
Fix OSX process invocation and add cwd
2 parents 87345d9 + 4b4a2b8 commit 6df8481

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

util.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function getLCUExecutableFromProcess() {
2828

2929
async function duplicateSystemYaml() {
3030
const LCUExePath = await getLCUExecutableFromProcess();
31-
const LCUDir = path.dirname(LCUExePath);
31+
const LCUDir = IS_WIN ? path.dirname(LCUExePath) : path.dirname(LCUExePath) + '/../../..';
3232

3333
const originalSystemFile = path.join(LCUDir, 'system.yaml');
3434
const overrideSystemFile = path.join(LCUDir, 'Config', 'rift-explorer', 'system.yaml');
@@ -51,8 +51,9 @@ async function duplicateSystemYaml() {
5151
function restartLCUWithOverride(LCUData) {
5252
return new Promise(async (resolve, reject) => {
5353
const LCUExePath = await getLCUExecutableFromProcess();
54-
const LCUDir = path.dirname(LCUExePath);
54+
const LCUDir = IS_WIN ? path.dirname(LCUExePath) : path.dirname(LCUExePath) + '/../../..';
5555
const overrideSystemFile = path.join(LCUDir, 'Config', 'rift-explorer', 'system.yaml');
56+
5657
const { username, password, address, port } = LCUData;
5758

5859
await requestPromise({
@@ -64,6 +65,7 @@ function restartLCUWithOverride(LCUData) {
6465
// Give it some time to do cleanup
6566
setTimeout(() => {
6667
const leagueProcess = spawn(LCUExePath.trim(), [`--system-yaml-override=${overrideSystemFile}`], {
68+
cwd: LCUDir,
6769
detached: true,
6870
stdio: 'ignore'
6971
});

0 commit comments

Comments
 (0)