From b617aa6ea6680ae11b8529c4f54bf912288d37c7 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 18 Apr 2026 20:16:42 -0400 Subject: [PATCH] Updated the removal for The Omega Reach so it actually works now. --- .../linux-game-manager-dev/references/core-map.md | 4 ++-- .../references/game-extension.md | 3 +-- linux-game-manager.sh | 11 ++++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.codex/skills/linux-game-manager-dev/references/core-map.md b/.codex/skills/linux-game-manager-dev/references/core-map.md index c95da65..c9fb5f1 100644 --- a/.codex/skills/linux-game-manager-dev/references/core-map.md +++ b/.codex/skills/linux-game-manager-dev/references/core-map.md @@ -41,7 +41,7 @@ python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py 3. **Removal flow** - `game_removal` resolves launcher entry to real script. -- It extracts the first `installPath`-containing line from launcher script to infer directory to remove. +- It scans launcher script lines for a non-comment `${installPath}/...` path assignment and uses that to infer the directory to remove. - If no `installPath` reference is found, only launcher entry is removed. 4. **Update flow** @@ -73,7 +73,7 @@ python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py - Mismatched `.install/.sh` vs `.launch/.game` names create orphaned or invisible entries. - Missing `installPath` reference in launcher prevents full uninstall. -- `game_removal` parses the first `installPath` match in launcher text, so comments containing `installPath` can break removal path detection. +- `game_removal` expects a concrete `${installPath}/...` path in the launcher; indirect path construction can prevent removal from finding the install directory. - Missing `run_update()` in `.update` scripts breaks update flow. - Bypassing shared download helpers risks cache and validation regressions. - Installers may change the working directory; repository-relative manager paths must therefore use the resolved script root rather than `${0%/*}`. diff --git a/.codex/skills/linux-game-manager-dev/references/game-extension.md b/.codex/skills/linux-game-manager-dev/references/game-extension.md index 29eccbc..a824dd7 100644 --- a/.codex/skills/linux-game-manager-dev/references/game-extension.md +++ b/.codex/skills/linux-game-manager-dev/references/game-extension.md @@ -127,5 +127,4 @@ Use this pattern for Python games installed with `uv` when runtime speech suppor - Launch via `uv run ...` from the same directory used for `uv sync`. 3. Removal safety: -- Ensure first `installPath` line in launcher points to a path that lets `game_removal` infer the game root correctly. -- Do not put `installPath` in comments above that path line, because removal currently grabs the first matching line. +- Ensure the launcher contains a concrete `${installPath}/...` path assignment so `game_removal` can infer the game root correctly. diff --git a/linux-game-manager.sh b/linux-game-manager.sh index af6e374..cfc4d55 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -790,9 +790,14 @@ game_removal() { gameFile="$(readlink -f "${scriptRoot}/.launch/${gameName}.sh")" # Get the actual installation path from the .game file local gameInstallPath - gameInstallPath="$(grep -F "installPath" "$gameFile" | grep -v 'pushd' | head -n1)" - gameInstallPath="${gameInstallPath#*/}" - gameInstallPath="${installPath}/${gameInstallPath%/*}" + while IFS= read -r line; do + [[ "${line}" == \#* ]] && continue + [[ "${line}" == *'pushd'* ]] && continue + if [[ "${line}" =~ \$\{installPath\}/([^\"]+) ]]; then + gameInstallPath="${installPath}/${BASH_REMATCH[1]}" + break + fi + done < "${gameFile}" if [[ -z "$gameInstallPath" ]] || [[ "${gameInstallPath%%/}" == "$installPath" ]]; then # No install path found, just remove from list ui_yesno "Linux Game Manager" "Linux Game Manager" "This will remove the game from your game list, but will not remove any files. Do you want to continue?" || exit 0