fix: detect GAMEDIR when declared as lowercase or exported - #152
Merged
Conversation
Contributor
Author
|
I did a shallow clone of Portmaster-New and found that these fix a handful of ports: From the export/lowercase fix:
From the leading-whitespace fix:
|
Owner
|
Happy to merge but currently got merge conflicts |
Some PortMaster scripts (e.g. Celeste.sh) declare the game directory as `export gamedir=...` instead of `GAMEDIR=...`. The grep for the gamedir line only matched the latter, so patching bailed out with "No GAMEDIR found" and the port refused to launch. Match case-insensitively and tolerate an optional `export` prefix, then fold the lowercase form into GAMEDIR for the downstream check. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
A handful of ports (e.g. Asteroludi) declare GAMEDIR inside an indented if/else block, so the line starts with whitespace. Allow optional leading whitespace in the grep so these ports patch correctly. When a script declares GAMEDIR in multiple branches the last assignment wins, which matches the branch that uses $directory — the value we want. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pobega
force-pushed
the
fix/gamedir-lowercase-export
branch
from
May 8, 2026 01:41
6cc250a to
4c87528
Compare
Contributor
Author
|
Rebased against main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some PortMaster scripts (e.g. Celeste.sh) declare the game directory as
export gamedir=...instead ofGAMEDIR=.... The grep for the gamedir line only matched the latter, so patching bailed out with "No GAMEDIR found" and the port refused to launch.Match case-insensitively and tolerate an optional
exportprefix, then fold the lowercase form into GAMEDIR for the downstream check.