Pupix / lcu-connector

🔌 Streamlined LCU integration for your app.
MIT License
111 stars 26 forks source link

Wrong INSTALL_REGEX on macOS fails to resolve LCU path #1

Closed OrangeNote closed 6 years ago

OrangeNote commented 6 years ago

When I do ps x | grep 'LeagueClientUx' on macOS, I get something like this (this is a trimmed example):

3477   ??  S      0:12.72 /Applications/League of Legends.app/Contents/LoL/RADS/projects/league_client/releases/0.0.0.120/deploy/League of Legends.app/Contents/MacOS/LeagueClientUx --release=0.0.0.89 --rads-product-directory=/Applications/League of Legends.app/Contents/LoL/RADS/solutions/league_client_sln/releases/0.0.0.89/deploy/ --install-directory=/Applications/League of Legends.app/Contents/LoL/ --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --no-proxy-server

const INSTALL_REGEX = /"--install-directory=(.*?)"/; fails to match my stdout. I don't know where the problem lies, (in my ps implementation or in your code?), so I'm not doing a pull request, but for now I fixed for me with: /--install-directory=(.+?)(?: --|$)/ it matches the required string (without those questionable double quotes) plus the beginning of another param or the end of the string (non capturing group).

Please, let me know if you can solve this problem or if I have to keep my fix. Thanks!

EDIT: found https://github.com/CodesignDev/lcu-connector/commit/73f4a4b5cd067b19d8d555827abdabe317b97f56 that probably solves the same issue.

Pupix commented 6 years ago

It's most likely the code that's broken. I don't have a mac and haven't tested it. Somebody else gave me that grep command. 🤷‍♂️ .

You can PR that and imma merge it.

Pupix commented 6 years ago

Aight, made a new release too.

CodesignDev commented 6 years ago

For some reason my notifications didn't go off on this so have only just seen it, but its no problem for helping fix this issue. Was planning on pushing a PR up for this myself but got side-tracked by real life.