fix(install): auto-rerun mise install when tool list changes#34
Merged
Conversation
run_onchange_after_50 only re-fired on its own content change — packages.yaml edits re-fire it (rendered into DOTFILES_* vars), but the mise config is read by mise directly, so adding/removing a mise tool didn't trigger `mise install` (hit on the jetson: direnv declared but not installed after chezmoi update). Embed the mise config's hash in the script (chezmoi's documented run_onchange dependency idiom: `include | sha256sum`). Now a tool add/remove changes the script → re-fires → mise install runs on apply. Demonstrated: dummy tool flips the hash. Docs updated (README + config header): 'chezmoi apply' now suffices.
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.
Problem
run_onchange_after_50-install-packagesre-fires only when its own content changes.packages.yamlis rendered into the script'sDOTFILES_*vars (so edits there re-fire it), but the mise config is read by mise directly — not rendered into the script. So adding/removing a mise tool didn't triggermise install.Hit live on the jetson: after merging the direnv PR,
chezmoi updateapplied the new mise config but never ranmise install→direnvdeclared yet not installed →command not found: direnv.Fix
Embed the mise config's hash in the script — chezmoi's documented
run_onchangedependency idiom:Tool add/remove → raw template changes → hash changes → script content changes →
run_onchangere-fires →mise installruns onchezmoi apply. Fires once per edit, then quiet (idempotent).Demonstrated
Adding a dummy tool flips the rendered hash
92e334…→71cc54…; revert restores it. shellcheck clean.Coverage (all 3 re-fire axes now closed)
DOTFILES_*✓ (existing)DOTFILES_PROFILE✓ (existing)Docs (README + mise config header) updated:
chezmoi applynow suffices, no manualmise install.