fix(install): wire BINDIR onto PATH in the shell profile, not a warning #3

Merged
dan-claude-bot merged 1 commit from fix/installer-path-wiring into main 2026-07-11 15:23:51 +00:00
dan-claude-bot commented 2026-07-11 15:12:40 +00:00 (Migrated from github.com)

Why

Standing up the coolify box for prod-migration Task 6, the operator ran the documented one-liner and got a working install that they could not invoke:

cast-install: WARNING: /home/daniel/.local/bin is not on your PATH.
cast-install: linked /home/daniel/.local/bin/cast -> ...
➜ cast --help
zsh: command not found: cast

curl | bash runs in a subshell, so the installer could never export PATH into the caller's shell — it warned instead, and a warning in a wall of install output is a step every fresh workstation has to notice and do by hand. source ~/.zshrc doesn't help either: the export was never written anywhere.

What

The installer now writes the PATH entry to whichever profile $SHELL actually reads, rather than telling you to:

  • zsh${ZDOTDIR:-$HOME}/.zshrc · bash.bashrc, or .bash_profile on macOS (login shells) · fishconfig.fish with fish_add_path · anything else → .profile
  • Idempotent: guarded by a # added by cast-install marker, so re-running to upgrade never duplicates the line.
  • No-op when $BINDIR is already on PATH (the root case, /usr/local/bin, normally is).
  • CAST_NO_MODIFY_PATH=1 opts out and restores the old warn-only behaviour, for people who manage PATH themselves.
  • The current shell still can't see it (subshell), so the installer now says exactly that: open a new shell, or source <the profile it named>.

Also: age is required before any apply/diff, and the bare "age not found" warning read as ignorable — it now names the install command per platform. Same operator hit this in the same session.

Verification

Ran the patched installer end-to-end against throwaway HOMEs in a container, one per shell flavour:

Case Result
zsh, fresh HOME .zshrc created with the export; source it → cast --help runs
zsh, re-run (upgrade path) marker detected, 1 export line, not 2
fish config.fish gets fish_add_path, not a bash export
CAST_NO_MODIFY_PATH=1 profile untouched, falls back to the warning

Plus bash -n install.sh (what CI gates on) and npm run check — both clean.

🤖 Generated with Claude Code

## Why Standing up the coolify box for prod-migration Task 6, the operator ran the documented one-liner and got a working install that they could not invoke: ``` cast-install: WARNING: /home/daniel/.local/bin is not on your PATH. cast-install: linked /home/daniel/.local/bin/cast -> ... ➜ cast --help zsh: command not found: cast ``` `curl | bash` runs in a subshell, so the installer could never export `PATH` into the caller's shell — it warned instead, and a warning in a wall of install output is a step every fresh workstation has to notice and do by hand. `source ~/.zshrc` doesn't help either: the export was never written anywhere. ## What The installer now **writes** the `PATH` entry to whichever profile `$SHELL` actually reads, rather than telling you to: - `zsh` → `${ZDOTDIR:-$HOME}/.zshrc` · `bash` → `.bashrc`, or `.bash_profile` on macOS (login shells) · `fish` → `config.fish` with `fish_add_path` · anything else → `.profile` - Idempotent: guarded by a `# added by cast-install` marker, so re-running to upgrade never duplicates the line. - No-op when `$BINDIR` is already on `PATH` (the root case, `/usr/local/bin`, normally is). - `CAST_NO_MODIFY_PATH=1` opts out and restores the old warn-only behaviour, for people who manage `PATH` themselves. - The current shell still can't see it (subshell), so the installer now says exactly that: open a new shell, or `source <the profile it named>`. Also: `age` is required before any `apply`/`diff`, and the bare "age not found" warning read as ignorable — it now names the install command per platform. Same operator hit this in the same session. ## Verification Ran the patched installer end-to-end against throwaway `HOME`s in a container, one per shell flavour: | Case | Result | | --- | --- | | zsh, fresh HOME | `.zshrc` created with the export; `source` it → `cast --help` runs | | zsh, re-run (upgrade path) | marker detected, **1** export line, not 2 | | fish | `config.fish` gets `fish_add_path`, not a bash export | | `CAST_NO_MODIFY_PATH=1` | profile untouched, falls back to the warning | Plus `bash -n install.sh` (what CI gates on) and `npm run check` — both clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: heavy-duty/cast#3
No description provided.