-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Goal
- Let
bootstrap's auto-linker run against a single "dotfiles scope" (e.g. justcodex) so we can refresh one symlink set without invoking the full bootstrap flow.
Current Behaviour
install_dotfilesinscript/bootstrap:340runs near the end of a full bootstrap, discovering every*.symlink(withfind -maxdepth 2), prompting for conflicts, and linking them into$HOME.- The only supported entrypoint is calling the whole
bootstrapscript; there's no CLI argument parsing, so every run also executes earlier setup steps (Homebrew, GPG, etc.). - That makes it heavy for quick, surgical relinks and encourages manual
ln -sworkarounds.
Proposal
- Keep bootstrap as the single downloadable script, but break the major phases (e.g. link, install, setup steps) into inner functions that are still defined in-place.
- Add lightweight argument parsing (
--help,--link,--link codex, etc.) so we can invoke just the linker while reusing the existinglink_filelogic. - Default behaviour (no args) should remain today's full bootstrap to keep curl|zsh usage intact.
Suggested Plan
- Introduce a simple dispatcher in
script/bootstrapthat records the requested action(s) while preserving backwards-compatible defaults. - Promote the current
install_dotfileslogic into a reusable function that accepts optional scope filters (e.g. a path or prefix), falling back to the existingfindwhen no filter is provided. - Thread the user prompts and conflict handling through the scoped path so we don't duplicate or drift from the current link behaviour.
- Document the new flags in the script header/README to make the scoped mode discoverable.
Original Prompt Notes
The following are some random notes and thoughts I provided to codex that it synthesised into the above; but that may still have value as originally written:
Can you draft a github issue title and description for the 'Minimal Tooling Tweak' refactor.
If it relates to files in script, then prefix the title with [script]
Give a brief description of the main aim of the refactor (allowing the autolinking to be focussed to a single 'dotfiles scope' (or better wording).
Then give a brief overview of where the existing functionality is, how it works, when it runs, and its limitations in terms of this task (eg. being able to manually run it for a single 'dotfiles scope'), etc.
Then give a brief suggested plan of how this could be achieved.
- I don't really like the env var suggestion of DOTFILES_LINK_ONLY=codex
- I think the original plan was that we wanted to ensure that the bootstrap script was a single self contained script so that it could be downloaded and run with something like curl | zsh or similar. I'm not 100% sure about that.. but if that was the case, then thats probably the reason why we haven't separated out various 'core' parts of it into different 'standalone helper libraries' or similar.
- Ideally we would keep things DRY and wouldn't duplicate core functionality across 2 different locations where the implementations could drift.
- I'm not sure of the current structure of the bootstrap file, but if it is as described above, I wonder if we could encapsulate different parts of its functionality into 'inner functions'; and then maybe could give it some argument parsing such as --help/etc, that could then allow us to access to some of the more specific parts of the functionality rather than needing to run the whole thing all in one go.See Also
Metadata
Metadata
Assignees
Labels
No labels