Why
On a fresh machine — the exact context where setup.zsh runs — the info helper is not yet in the shell environment, so the script can crash with command not found: info at the end of an otherwise successful run.
Current state
features/setup/setup.zsh calls info "🎉 Setup complete!" on line 129. The info function is defined in tools/zsh/utils.zsh and tools/bash/utils.bash, but setup.zsh never sources either file. The script also uses info indirectly via the files it sources (features/install/zsh/ssh.zsh line 16, features/install/zsh/github.zsh line 9, features/install/zsh/content.zsh line 15). On a machine where dotfiles are not yet symlinked and the full Zsh environment is not loaded, all of these calls fail with command not found: info.
Ideal state
setup.zsh sources tools/zsh/utils.zsh (or an equivalent helper) near the top, before any call to info, error, or other utilities from that file.
- Running
setup.zsh on a fresh machine with no prior dotfiles symlinks completes without a command not found error on info.
- If sourcing the utils file is not feasible at that point in the script, the calls to
info are replaced with plain printf statements as a fallback.
Out of scope
- Adding a full fallback shim for every utility in
utils.zsh — the minimal fix is either sourcing the file early or replacing only the info calls with printf.
- Changes to the sourced install scripts (
ssh.zsh, github.zsh, etc.) beyond what is necessary to make setup.zsh work on a fresh machine.
Starting points
features/setup/setup.zsh — line 4 sets $DOTFILES; line 129 calls info; no source of any utils file appears anywhere in the file.
tools/zsh/utils.zsh — defines info() at line 84; this is the canonical source for the function.
features/install/zsh/ssh.zsh, github.zsh, content.zsh — each calls info without sourcing the utils file, relying on the ambient shell environment to provide it.
QA plan
- Open a fresh zsh session with no dotfiles sourced (e.g.
env -i HOME=$HOME zsh --no-rcs) and source setup.zsh — expect no command not found: info error at any point during execution.
- Confirm the "🎉 Setup complete!" message is visible in the terminal output.
- Run
zsh -n features/setup/setup.zsh — expect no syntax errors.
Done when
setup.zsh runs to completion on a shell with no pre-loaded dotfiles environment without producing a command not found: info error.
Why
On a fresh machine — the exact context where
setup.zshruns — theinfohelper is not yet in the shell environment, so the script can crash withcommand not found: infoat the end of an otherwise successful run.Current state
features/setup/setup.zshcallsinfo "🎉 Setup complete!"on line 129. Theinfofunction is defined intools/zsh/utils.zshandtools/bash/utils.bash, butsetup.zshnever sources either file. The script also usesinfoindirectly via the files it sources (features/install/zsh/ssh.zshline 16,features/install/zsh/github.zshline 9,features/install/zsh/content.zshline 15). On a machine where dotfiles are not yet symlinked and the full Zsh environment is not loaded, all of these calls fail withcommand not found: info.Ideal state
setup.zshsourcestools/zsh/utils.zsh(or an equivalent helper) near the top, before any call toinfo,error, or other utilities from that file.setup.zshon a fresh machine with no prior dotfiles symlinks completes without acommand not founderror oninfo.infoare replaced with plainprintfstatements as a fallback.Out of scope
utils.zsh— the minimal fix is either sourcing the file early or replacing only theinfocalls withprintf.ssh.zsh,github.zsh, etc.) beyond what is necessary to makesetup.zshwork on a fresh machine.Starting points
features/setup/setup.zsh— line 4 sets$DOTFILES; line 129 callsinfo; nosourceof any utils file appears anywhere in the file.tools/zsh/utils.zsh— definesinfo()at line 84; this is the canonical source for the function.features/install/zsh/ssh.zsh,github.zsh,content.zsh— each callsinfowithout sourcing the utils file, relying on the ambient shell environment to provide it.QA plan
env -i HOME=$HOME zsh --no-rcs) and sourcesetup.zsh— expect nocommand not found: infoerror at any point during execution.zsh -n features/setup/setup.zsh— expect no syntax errors.Done when
setup.zshruns to completion on a shell with no pre-loaded dotfiles environment without producing acommand not found: infoerror.