docs: pass -b to the bootstrap so chezmoi lands on PATH - #19
Merged
Conversation
The installer defaults to BINDIR=bin, which is relative, so the README one-liner put chezmoi in $PWD/bin/chezmoi — not on PATH. The failure is delayed and confusing: the installer execs the binary it just placed, so `init --apply` succeeds and the machine looks fine until the next shell reports `chezmoi: command not found`. install.sh already passed -b "$HOME/.local/bin"; the README, which is the documented path for a new machine, did not. Not using get.chezmoi.io/lb: it hardcodes a relative .local/bin, so it only lands correctly when run from $HOME. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2p4TH5SX7B3J8oAQaidc8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18. Fixes the
chezmoi: command not foundseen after a fresh install.The bug
The README's new-machine one-liner had no
-b:sh -c "$(curl -fsSL https://get.chezmoi.io)" -- init --apply natevickThe installer defaults to
BINDIR="${BINDIR:-bin}"— relative. So chezmoi lands in$PWD/bin/chezmoi, wherever you happened to run the command, and~/.local/bin(whatdot_zshenvputs on PATH) never gets it.The failure is delayed and misleading: the installer ends with
exec "${BINDIR}/${BINARY}" "${@}", so it runs the binary it just placed andinit --applysucceeds. Everything looks fine until the next shell reportschezmoi: command not found.install.shalready passed-b "$HOME/.local/bin"— only the README, the documented path for a new machine, was wrong.Why not
get.chezmoi.io/lbThe installer suggests it when
-b .local/binis passed, but it setsBINDIR="${BINDIR:-.local/bin}"— also relative, so it only lands correctly when run from$HOME. The explicit absolute-b "$HOME/.local/bin"matchesinstall.shand is cwd-independent.Verification
Ran the corrected shape against a scratch dir:
-bhonored and the trailing subcommand exec'd. Note--versionis not a valid trailing arg there — it's consumed bygetoptsand prints usage; a subcommand likeinitstops option parsing cleanly, which is why the real command works.Recovery on an already-broken machine
Just reinstall the binary to the right place — no need to re-run init:
🤖 Generated with Claude Code
https://claude.ai/code/session_01H2p4TH5SX7B3J8oAQaidc8