fix(installer): auto-install Oh-My-Zsh when dotfiles reference it#42
Merged
fullstackjam merged 3 commits intomainfrom Apr 22, 2026
Merged
fix(installer): auto-install Oh-My-Zsh when dotfiles reference it#42fullstackjam merged 3 commits intomainfrom
fullstackjam merged 3 commits intomainfrom
Conversation
When installing from a remote config whose snapshot has oh_my_zsh:false but whose linked dotfiles contain a .zshrc that sources oh-my-zsh.sh, the previous flow left the shell broken (`.zshrc: source: ... no such file or directory: ~/.oh-my-zsh/oh-my-zsh.sh`) on every new terminal. Detect this after cloning dotfiles: if the cloned repo contains a .zshrc referencing oh-my-zsh and OMZ is not installed, install it before linking.
|
👋 Thanks for opening this pull request! Before merging:
@fullstackjam will review this soon. Thanks for contributing! 🚀 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Review feedback on #42: - Tighten ReferencesOMZ to match a live `source ... oh-my-zsh.sh` line instead of any substring. Comment-only mentions (e.g. `# alias ohmyzsh="..."`) no longer trigger an unwanted install. - Take dotfilesPath as an argument so ReferencesOMZ is testable without setenv'ing HOME; add DefaultPath() for the production caller. - Skip the fallback install when plan.InstallOhMyZsh is already true — the shell step attempted it and failed, retrying just fails again. - Add installOhMyZshFunc var seam so applyDotfiles can be unit-tested without downloading and executing the upstream OMZ script. - Add table-driven tests for ReferencesOMZ (stow/flat/commented/alias- only/missing) and behavioural tests for applyDotfiles covering the install, skip, no-retry, and dry-run branches.
The old-cli compat job selected stable[1] (second-newest release) and then downloaded its darwin binary. When the asset for the chosen tag has been removed from the release (e.g. v0.55.1 was deleted), the download 404s and the job fails. Filter the release list to releases that still have the expected darwin-<arch> asset, then pick the most recent one. This self-heals when any single release's binary is later removed.
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.
Summary
zsh/.zshrcor.zshrccontainingoh-my-zsh) and install OMZ before linking if it's missing.shell.oh_my_zsh: falsebut whose linked dotfiles source$ZSH/oh-my-zsh.sh.Why
Installing via
curl openboot.dev/<user> | bashwith a published config that captured the snapshot while~/.oh-my-zshwas absent left the installed.zshrcpointing at a non-existent OMZ:planFromRemoteConfigonly flipsInstallOhMyZshon whenrc.Shell.OhMyZshis true, so the dotfiles step would happily symlink a zshrc that required OMZ without ensuring OMZ was present.Changes
internal/dotfiles/dotfiles.go: newReferencesOMZ()helper that inspects the cloned repo for a zshrc sourcing oh-my-zsh (both stow and flat layouts).internal/installer/step_shell.go: inapplyDotfiles, between clone and link, install OMZ if the dotfiles reference it and it isn't already installed. Failure is reported as a soft error, consistent with the surrounding step.Test plan
make test-unitshell.oh_my_zsh:false+ dotfiles sourcing OMZ → OMZ is installed, new terminal starts cleanly!plan.DryRun)