Share definitions via lib.sh, fold Launch Clipy into login items - #2
Merged
Conversation
bootstrap.sh and doctor.sh each carried their own copy of the stow package list, the Brewfile tier logic, the .machine read, and the platform check. Nothing kept them in sync: adding a stow package meant editing two lists, and doctor.sh's ssh --no-folding was a bare literal that had to match bootstrap.sh's by hand. Move all of it into lib.sh — DOTFILES_DIR, PLATFORM, STOW_PACKAGES, SSH_STOW_OPTS, and helpers for loading/saving the machine tier and resolving in-scope Brewfiles. The file only defines; sourcing it runs nothing. Launch Clipy was built and registered as a login item by build-launch-clipy.sh, outside LOGIN_ITEM_APPS, so --check never covered it. Make the applet a LOGIN_ITEM_APPS row and have defaults.sh build it just before the login-item pass. Its own existence can't ride on that row — process_login_items skips apps that aren't present, so an unbuilt applet is indistinguishable from an uninstalled one — hence build-launch-clipy.sh --check, exiting 0 built / 1 missing / 3 n/a when Clipy or the Automator stub is absent. CI listed its lint targets by hand, so a new script shipped unlinted. Derive them from git ls-files instead, for shellcheck, zsh -n, the Brewfiles, and plutil. Smaller cleanups along the way: - FileVault was reported by both defaults.sh and doctor.sh. Drop the defaults.sh copy; drift reporting belongs in doctor.sh, and the README now says so. - Replace bootstrap.sh's read/[[ =~ ]] prompt pairs with confirm() and interactive(), so the --yes and no-tty cases are decided in one place. - --help was sed -n '2,10p' of the script's own header, silently wrong the moment a line moved. Use a usage() heredoc. - Add doctor.sh's detail() for the four places that indented captured output line by line. - Drop bootstrap.sh's trailing ~/.zshrc check: readlink -f against a glob inside [[ ]] is a literal comparison that never matched, and the stow section already reports this. - Replace basename with parameter expansion in the login-item and Dock paths, and compare Dock names without grep so an app name containing regex metacharacters can't misreport. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AY9x8Cs9gZTgMMRfsW23ay
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.
bootstrap.shanddoctor.sheach carried their own copy of the stow package list, the Brewfile tier logic, the.machineread, and the platform check. Nothing kept them in sync: adding a stow package meant editing two lists, anddoctor.sh's ssh--no-foldingwas a bare literal that had to matchbootstrap.sh's by hand. All of it moves intolib.sh—DOTFILES_DIR,PLATFORM,STOW_PACKAGES,SSH_STOW_OPTS, and helpers for loading/saving the machine tier and resolving in-scope Brewfiles. The file only defines; sourcing it runs nothing.Launch Clipy was built and registered as a login item by
build-launch-clipy.sh, outsideLOGIN_ITEM_APPS, so--checknever covered it. The applet is now aLOGIN_ITEM_APPSrow, built bydefaults.shjust before the login-item pass. Its own existence can't ride on that row —process_login_itemsskips apps that aren't present, so an unbuilt applet is indistinguishable from an uninstalled one — hencebuild-launch-clipy.sh --check, exiting 0 built / 1 missing / 3 n/a when Clipy or the Automator stub is absent.CI listed its lint targets by hand, so a new script could ship unlinted. Targets now come from
git ls-filesfor shellcheck,zsh -n, the Brewfiles, and plutil.Smaller cleanups
defaults.shanddoctor.sh. Dropped thedefaults.shcopy; drift reporting belongs indoctor.sh, and the README now says so.bootstrap.sh'sread/[[ =~ ]]prompt pairs becomeconfirm()andinteractive(), deciding the--yesand no-tty cases in one place.--helpwassed -n '2,10p'of the script's own header, silently wrong the moment a line moved. Now ausage()heredoc.doctor.sh'sdetail()for the four places that indented captured output line by line.bootstrap.sh's trailing~/.zshrccheck:readlink -fagainst a glob inside[[ ]]is a literal comparison that never matched, and the stow section already reports this.basenamewith parameter expansion in the login-item and Dock paths, and compare Dock names withoutgrepso an app name containing regex metacharacters can't misreport.Verification
git ls-files '*.sh' | xargs shellcheck— cleanbash -non every tracked script — cleanlib.shsources cleanly; helpers resolvePLATFORM=macos, tiercore only, one in-scope Brewfile🤖 Generated with Claude Code
https://claude.ai/code/session_01AY9x8Cs9gZTgMMRfsW23ay