Extract shared install logic into lib/common.sh - #2
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Extract shared install logic into lib/common.sh#2devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
install.sh and uninstall.sh duplicated their configuration block, the remove_link_if_target helper, the GNU Stow guard, the Stow ignore flags, both Stow invocations, and the legacy-link cleanup. Move all of it into a sourced lib/common.sh so each script keeps only its distinct steps. The shared Stow ignore list now also excludes lib, preventing the new helper directory from being symlinked into the skills targets. Consolidating the legacy-skill cleanup into one list fixes a drift bug: uninstall.sh was missing the grill-me entry that install.sh removed, so a stale grill-me link would survive uninstall. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
install.shanduninstall.shwere near-duplicates: they shared the same config block, theremove_link_if_targethelper, the GNU Stow guard, the Stow--ignoreflags (each repeated twice for Claude + Codex), and the legacy-link cleanup. This factors all of that into a sourcedlib/common.sh, leaving each script with only its distinct steps.The scripts now reduce to:
lib/common.shcomputesREPO_DIRfrom${BASH_SOURCE[0]}(not$0), so it resolves the repo root correctly whether sourced from either script.Two behavioral fixes fall out of the consolidation:
STOW_IGNORESlist adds--ignore='lib', so the new helper directory is not itself symlinked into~/.claude/skills/~/.codex/skills.LEGACY_SKILLSarray used by both scripts. Previouslyuninstall.shwas missing thegrill-meentry thatinstall.shhad, so a stalegrill-melink could survive an uninstall; both scripts now stay in sync.Verification
shellcheck install.sh uninstall.sh lib/common.sh— clean../install.shagainst tempCLAUDE_HOME/CODEX_HOME: all skills symlinked;lib,README.md,AGENTS.md,install.sh,uninstall.shcorrectly excluded;CLAUDE.mdlinked toAGENTS.md. Re-running is idempotent../uninstall.sh: all skill links,CLAUDE.md, and the now-empty skills dirs removed.Link to Devin session: https://app.devin.ai/sessions/62a9f4fade1c4277bc0e272137e1a8d9
Requested by: @sidwood