refactor(setup): restructure installer into setup/ modules - #206
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restructures the dotfiles installer by moving the previously monolithic shell/functions library into a new setup/ module layout, making setup.sh a thin orchestrator with --help and --reinstall support, while preserving behavior aside from the two stated bug fixes (backup path and reinstall entrypoint).
Changes:
- Split installer logic into
setup/*.shmodules (common, symlinks, packages, languages, tools, services) and removedshell/functions. - Updated
setup.shto source modules, handle CLI flags (--help,--reinstall), and orchestrate interactive flows. - Updated docs to reflect the new reinstall mechanism (
./setup.sh --reinstall).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| shell/functions | Removed legacy installer function library (replaced by setup/ modules). |
| setup/common.sh | Common helper functions (section output, OS detection, GitHub release tag lookup, AUR helper logic). |
| setup/symlinks.sh | Directory initialization + backup + symlink creation logic (now uses ${SCRIPT_PATH}/backups). |
| setup/packages-arch.sh | Arch package installation and post-install steps. |
| setup/packages-wsl.sh | WSL/Ubuntu package installation and related setup helpers. |
| setup/languages.sh | Language/runtime/toolchain installers (nvm/node, rustup, composer, pipx, cargo). |
| setup/tools.sh | Tool installers (zinit, tmux TPM). |
| setup/services.sh | Service setup functions (systemd units + MySQL bootstrap). |
| setup.sh | New orchestrator: sources modules, provides --help/--reinstall, runs interactive flow. |
| README.md | Docs updated to use ./setup.sh --reinstall instead of a shell function. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nd package arrays safely
… temp file, SCRIPT_PATH for emoji conf
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.
What
Restructure the installer for clearer design, behavior-preserving except two latent bug fixes.
shell/functions(which lived undershell/but was only ever sourced bysetup.sh) into a newsetup/directory split by concern:common.sh,symlinks.sh,packages-arch.sh,packages-wsl.sh,languages.sh,tools.sh,services.sh.setup.shinto a thin orchestrator: sources the modules, owns the y/n prompts and OS dispatch, and adds--help/--reinstall.shell/functions.Bug fixes
backup()wrote to a hardcoded${HOME}/.dotfiles/backups/; now uses${SCRIPT_PATH}/backups/(worked only when the repo lived at~/.dotfiles).reinstall_dotfileswas documented but never sourced into any shell, so it was uncallable; replaced by./setup.sh --reinstall.Notes
# shellcheck disable=...directives were added becauseshell/functionswas never CI-linted but the new.shfiles are.README.md,CLAUDE.md) updated to the new layout.Verification
shellcheck setup.sh setup/*.shclean;bash -non all files passes../setup.sh --helpand unknown-flag handling verified.