Skip to content

fix: Respect PAI_DIR environment variable in v4.0.3 installer#994

Open
sbusc wants to merge 1 commit intodanielmiessler:mainfrom
sbusc:fix/install-respect-pai-dir-env
Open

fix: Respect PAI_DIR environment variable in v4.0.3 installer#994
sbusc wants to merge 1 commit intodanielmiessler:mainfrom
sbusc:fix/install-respect-pai-dir-env

Conversation

@sbusc
Copy link
Copy Markdown

@sbusc sbusc commented Mar 25, 2026

Summary

The v4.0.3 installer hardcodes ~/.claude as the PAI directory in several fallback paths, ignoring the PAI_DIR environment variable. Users who set PAI_DIR to a custom path get a broken installation because detection, configuration, validation, and voice setup all fall back to ~/.claude instead of respecting the env var.

Changes

4 files in Releases/v4.0.3/.claude/PAI-Install/:

  • engine/detect.ts — Read PAI_DIR from process.env when detecting system paths
  • engine/actions.ts — Add process.env.PAI_DIR fallback in repository, configuration, and voice setup steps (3 locations)
  • engine/validate.ts — Add process.env.PAI_DIR fallback in validation checks
  • install.sh — Pass through PAI_DIR if set; fix unbound variable errors for DISPLAY/WAYLAND_DISPLAY in headless detection (set -euo pipefail compatibility)

Test plan

  • Run bash install.sh without PAI_DIR set — should default to ~/.claude (no behavior change)
  • Run PAI_DIR=~/custom/.claude bash install.sh — should install to ~/custom/.claude
  • Run installer on headless Linux without DISPLAY set — should not error on unbound variable

The v4.0.3 installer hardcodes ~/.claude as the PAI directory in several
places, ignoring the PAI_DIR environment variable. Users who set PAI_DIR
to a custom path get a broken installation because the fallback always
resolves to ~/.claude.

Changes:
- detect.ts: Read PAI_DIR from process.env when detecting system paths
- actions.ts: Add PAI_DIR fallback in repository, configuration, and
  voice setup steps (3 locations)
- validate.ts: Add PAI_DIR fallback in validation checks
- install.sh: Pass through PAI_DIR if set, fix unbound variable errors
  for DISPLAY/WAYLAND_DISPLAY in headless detection
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.

1 participant