Skip to content

fix: detect GAMEDIR when declared as lowercase or exported - #152

Merged
ben16w merged 2 commits into
ben16w:mainfrom
Pobega:fix/gamedir-lowercase-export
May 8, 2026
Merged

fix: detect GAMEDIR when declared as lowercase or exported#152
ben16w merged 2 commits into
ben16w:mainfrom
Pobega:fix/gamedir-lowercase-export

Conversation

@Pobega

@Pobega Pobega commented May 7, 2026

Copy link
Copy Markdown
Contributor

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.

@Pobega

Pobega commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

I did a shallow clone of Portmaster-New and found that these fix a handful of ports:

From the export/lowercase fix:

  • Anodyne
  • Bleed
  • Bleed 2
  • Celeste
  • Chasm
  • Chicory: A Colorful Tale
  • Dust: An Elysian Tail
  • Fire Arrow Plus
  • Flinthook
  • Mercenary Kings
  • Panzer Paladin
  • Pizza Tower
  • Stardew Valley
  • TMNT: Shredder's Revenge
  • TowerFall Ascension
  • Ubermosh Collection

From the leading-whitespace fix:

  • Asteroludi

@ben16w

ben16w commented May 7, 2026

Copy link
Copy Markdown
Owner

Happy to merge but currently got merge conflicts

Pobega and others added 2 commits May 7, 2026 21:39
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
Pobega force-pushed the fix/gamedir-lowercase-export branch from 6cc250a to 4c87528 Compare May 8, 2026 01:41
@Pobega

Pobega commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased against main

@ben16w
ben16w merged commit b0c884e into ben16w:main May 8, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants