fix(cli): link and unlink docker CLI tools in brew hooks#148
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Homebrew hook support to expose bundled Docker CLI tools immediately after brew install, and to clean up those links on uninstall without touching non-ArcBox-owned symlinks.
Changes:
- Link Docker CLI tool symlinks from the app bundle’s
Contents/MacOS/xbin/into/usr/local/binduringbrew-postflight. - Remove ArcBox-owned Docker CLI tool symlinks from
/usr/local/binduringbrew-uninstall. - Introduce app-bundle
xbin/discovery plus link/unlink helper functions.
66144bb to
951e91e
Compare
brew-postflight creates /usr/local/bin symlinks for docker, docker-buildx, docker-compose, and docker-credential-osxkeychain pointing to the bundled xbin/ directory (path 3). brew-uninstall removes them, but only if ArcBox-owned. Consolidate duplicated symlink logic into commands/symlink.rs: - is_arcbox_owned() moved to arcbox-constants (single source of truth) - detect_bundle_xbin(), decide_link(), safe_link/unlink(), link_all/unlink_all_docker_tools() shared across all three paths - internal.rs, setup.rs, docker.rs, helper/cli.rs all delegate to shared code - 8 unit tests covering link/unlink/idempotency/ownership Documents all three Docker CLI discovery paths in module docs: Path 1: daemon → helper → /usr/local/bin (root, system-wide) Path 2: setup install → ~/.arcbox/bin (user-space, no root) Path 3: brew hooks → /usr/local/bin (no root on Homebrew systems)
951e91e to
8ab548b
Compare
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.
Brew-postflight now creates /usr/local/bin symlinks for docker, docker-buildx, docker-compose, and docker-credential-osxkeychain pointing to the bundled xbin/ directory. brew-uninstall removes them, but only if they are ArcBox-owned — symlinks belonging to Docker Desktop or other tools are left untouched.