chr-fritz / docker-completion.zshplugin

ZSH Plugin to load the completions for docker and docker-compose from the Docker for Mac app.
Apache License 2.0
14 stars 3 forks source link

Linking fails due to non-existent path #4

Closed biggianteye closed 3 weeks ago

biggianteye commented 2 years ago

I have followed the instructions in the oh-my-zsh section of the README and when I reload my ~/.zshrc I get this error message:

ln: /usr/local/share/zsh/site-functions/_docker: No such file or directory
ln: /usr/local/share/zsh/site-functions/_docker-compose: No such file or directory

This is down to the following line which contains a hardcoded base path of /usr/local/share/zsh/site-functions:

https://github.com/chr-fritz/docker-completion.zshplugin/blob/a2fe1c0a79f9dcf6d737934cb1debf6fc1ddc2f2/docker-completion.plugin.zsh#L19

On my machine running Monterey (12.4) I don't have that folder.

chr-fritz commented 2 years ago

Hi, can you provide some addtional information about your setup? Which ZSH version do you use, the original Apple version or a custom installed variant using brew?

biggianteye commented 1 year ago
➜  ~ zsh --version
zsh 5.9 (arm-apple-darwin21.3.0)

➜  ~ which zsh
/opt/homebrew/bin/zsh

I have a /opt/homebrew/share/zsh/site-functions directory which contains some completion files, so maybe this is simply a difference between the Apple and brew zsh installations?

Let me know if there's any more information you need.

behnam-io commented 1 year ago

I have exactly the same problem.

/Macos M1 Pro, Version 12.5.1 zsh 5.8.1 (x86_64-apple-darwin21.0)

sandzhaj commented 1 year ago

I have exactly the same problem.

/Macos M1 Pro, Version 12.5.1 zsh 5.8.1 (x86_64-apple-darwin21.0)

➜  ~ zsh --version
zsh 5.9 (arm-apple-darwin21.3.0)

➜  ~ which zsh
/opt/homebrew/bin/zsh

I have a /opt/homebrew/share/zsh/site-functions directory which contains some completion files, so maybe this is simply a difference between the Apple and brew zsh installations?

Let me know if there's any more information you need.

Just read the Readme.md

cd docker-completion sudo zsh docker-completion.plugin.zsh

You have to run it once with sudo permissions from plugin directory. For me it was ~/.zgen/chr-fritz/docker-completion.zshplugin-master

sdondley commented 1 year ago

I have the same issue with errors when starting new shell. Running Ventura.

zsh 5.9 (x86_64-apple-darwin22.0)

I'm using oh-my-zsh.

mikbuch commented 1 year ago

The same problem here. @sandzhaj , your fix did not work for me, I got the same linking errors

➜  ~ zsh --version
zsh 5.9 (x86_64-apple-darwin22.0)
➜  ~ docker --version
Docker version 24.0.2, build cb74dfc
~/.oh-my-zsh/custom/plugins
➜  plugins git:(master) cd docker-completion
➜  docker-completion git:(master) sudo zsh docker-completion.plugin.zsh
Password:
ln: /usr/local/share/zsh/site-functions/_docker: No such file or directory
ln: /usr/local/share/zsh/site-functions/_docker-compose: No such file or directory
reifyhealth-caseybecking commented 3 months ago

Same issue here -

zsh --version
zsh 5.9 (x86_64-apple-darwin23.0)

docker --version
Docker version 26.1.1, build 4cf5afa
chr-fritz commented 3 weeks ago

The Docker CLI now offers auto-completion itself. More information can be found in the Docker documentation.