Skip to content

Commit 43d27ab

Browse files
webcaneclaude
andcommitted
fix(brew): install symlink via lib/docker/cli-plugins, remove post_install
The post_install home-directory symlink approach hits Errno::EPERM in Homebrew's sandbox on macOS. sandbox_allowlist? is not a real Homebrew API. Fix: add (lib/"docker/cli-plugins").install_symlink to the install block — inside the Homebrew prefix, no sandbox issues. Same pattern as docker-compose and docker-buildx. Removes post_install and custom_block entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 08514ef commit 43d27ab

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

‎.goreleaser.yaml‎

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,15 @@ brews:
4848
license: "MIT"
4949
install: |
5050
bin.install "docker-deploy"
51-
post_install: |
52-
cli_plugins = Pathname.new("#{Dir.home}/.docker/cli-plugins")
53-
cli_plugins.mkpath
54-
target = "#{cli_plugins}/docker-deploy"
55-
src = "#{opt_bin}/docker-deploy"
56-
File.delete(target) if File.symlink?(target)
57-
begin
58-
File.symlink(src, target)
59-
rescue Errno::EPERM
60-
opoo "Could not create symlink to ~/.docker/cli-plugins/docker-deploy. " \
61-
"See `brew info docker-deploy` for manual instructions."
62-
end
63-
custom_block: |
64-
def sandbox_allowlist? = true
51+
(lib/"docker/cli-plugins").install_symlink bin/"docker-deploy"
52+
caveats: |
53+
docker-deploy is installed as a Docker CLI plugin.
6554
66-
def uninstall
67-
target = "#{Dir.home}/.docker/cli-plugins/docker-deploy"
68-
File.delete(target) if File.exist?(target)
69-
end
55+
The plugin symlink was created at:
56+
#{HOMEBREW_PREFIX}/lib/docker/cli-plugins/docker-deploy
57+
58+
If Docker does not discover it automatically, link it manually:
59+
ln -sf #{opt_bin}/docker-deploy ~/.docker/cli-plugins/docker-deploy
7060
test: |
7161
system "#{bin}/docker-deploy", "docker-cli-plugin-metadata"
7262

0 commit comments

Comments
 (0)