Repository navigation
fix(installer): resolve repo root correctly in bash scripts under installer/ - #1332
Conversation
…taller/ The bash counterparts to the PowerShell scripts fixed in #1326 had the identical off-by-one bug: both climbed one parent directory too few from installer/scripts/, so $REPO_ROOT / $PROJECT_ROOT pointed at installer/ instead of the repo root. Downstream $WEBUI_DIR / $ELECTRON_DIR then resolved to the non-existent installer/src/gaia/apps/webui, breaking start-agent-ui.sh --frontend-only and build-ui-installer.sh on Linux/macOS. Both scripts live at installer/scripts/, so the correct traversal is $SCRIPT_DIR/../.. (two levels up to repo root).
|
Both bash scripts had the identical off-by-one path bug that was fixed in the PowerShell counterparts in #1326 — this PR applies the same fix correctly. The change is minimal, surgical, and verified by the directory structure ( SummaryScripts at Issues FoundNone. Strengths
VerdictApprove — correct fix, minimal diff, no side effects. The manual end-to-end step (running |
…md#1395) ## Why this matters amd#1332 fixed the off-by-one repo-root bug in `start-agent-ui.sh` and `build-ui-installer.sh` (the bash counterparts to the PowerShell fix in amd#1326), but shipped with only a manual `bash -n` test plan — nothing in CI stops the `$SCRIPT_DIR/..` → `installer/` regression from creeping back in if either script is moved or edited again. amd#1328 is still open precisely because the fix was never pinned. This adds the regression coverage: a pure-stdlib test that parses both scripts and asserts the two-levels-up traversal resolves to the real repo root, that `$WEBUI_DIR`/`$ELECTRON_DIR` point at `src/gaia/apps/webui` and `src/gaia/electron` (which exist on a fresh checkout), and that the old one-level traversal would have landed on `installer/`. No production code changes — the fix is already on `main`. Closes amd#1328. ## Test plan - [x] `python -m pytest tests/unit/installer/test_bash_script_paths.py` — 3 passed against the current (fixed) scripts. - [x] Sanity: temporarily reverting either script to `$SCRIPT_DIR/..` makes the corresponding test fail (the guard actually guards). - [x] `black --check` and `isort --check-only` clean on the new file. ## Out of scope - The script fix itself (already merged in amd#1332). - PowerShell counterparts (amd#1326). --------- Co-authored-by: martin <[email protected]>
Why this matters
On a fresh Linux/macOS checkout,
start-agent-ui.sh --frontend-onlyandbuild-ui-installer.shwere runningnpm/electron-forgeagainst the non-existentinstaller/src/gaia/apps/webuiinstead of the realsrc/gaia/apps/webui, silently producing a broken installer or failing prerequisite checks. These are the bash counterparts to the two PowerShell scripts fixed in #1326 — flagged in that PR's review as having the identical off-by-one bug, deliberately deferred to this follow-up. Both scripts live atinstaller/scripts/, so the correct traversal is$SCRIPT_DIR/../..(two levels up to repo root), not$SCRIPT_DIR/..(one level, stopping atinstaller/).Follow-up to #1326.
Test plan
bash -nparses both scripts with no errors.cd "$SCRIPT_DIR/../.."frominstaller/scripts/resolves to repo root, andsrc/gaia/apps/webui/package.jsonis found there.git diffis scope-clean: only the two.shfiles, 2 insertions / 2 deletions../installer/scripts/start-agent-ui.sh --frontend-onlyrunsnpmin the correct directory;./installer/scripts/build-ui-installer.sh --browserbuilds against the realsrc/gaia/apps/webui.