Skip to content

Commit

Permalink
Merge pull request #60 from realytcracker/patch-1
Browse files Browse the repository at this point in the history
Fix OSX process invocation and add cwd
  • Loading branch information
Pupix authored Jun 16, 2019
2 parents 87345d9 + 4b4a2b8 commit 6df8481
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getLCUExecutableFromProcess() {

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

const originalSystemFile = path.join(LCUDir, 'system.yaml');
const overrideSystemFile = path.join(LCUDir, 'Config', 'rift-explorer', 'system.yaml');
Expand All @@ -51,8 +51,9 @@ async function duplicateSystemYaml() {
function restartLCUWithOverride(LCUData) {
return new Promise(async (resolve, reject) => {
const LCUExePath = await getLCUExecutableFromProcess();
const LCUDir = path.dirname(LCUExePath);
const LCUDir = IS_WIN ? path.dirname(LCUExePath) : path.dirname(LCUExePath) + '/../../..';
const overrideSystemFile = path.join(LCUDir, 'Config', 'rift-explorer', 'system.yaml');

const { username, password, address, port } = LCUData;

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

0 comments on commit 6df8481

Please sign in to comment.