mattmc3 / antidote

https://getantidote.github.io - the cure to slow zsh plugin management
MIT License
892 stars 21 forks source link

Doesn't seem to work with mnowotnik/fzshell #136

Closed eggbean closed 1 year ago

eggbean commented 1 year ago

I tried this mnowotnik/fzshell plugin, which only mentions support for zplug.

I added it to zsh_plugins.txt as mnowotnik/fzshell.

I'm not sure how to use it, but when I type docker rmi and then type ctrl-n I get this error:

fzshell_widget:3: no such file or directory: /home/jason/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-mnowotnik-SLASH-fzshell/fzshell

mattmc3 commented 1 year ago

The install instructions for fzshell indicate that there's an install.sh script you need to run to use it: https://github.com/mnowotnik/fzshell/tree/master#using-git

ZPlug has a post-install hook that runs the install script (hook-build:"./scripts/install.sh --no-instructions").

You can easily add a hook to antidote too:

# .zsh_plugins.txt
mnowotnik/fzshell post:fzshell_verify_install

And then somewhere in your .zshrc before loading antidote, define your post bundle hook function:

function fzshell_verify_install {
  local fzshell=$(antidote path mnowotnik/fzshell)/fzshell
  local installer=$(antidote path mnowotnik/fzshell)/scripts/install.sh
  if [[ -e $installer ]] && [[ ! -e $fzshell ]]; then
    $installer --no-instructions
  fi
}
eggbean commented 1 year ago

Thanks. I use these sort of hooks with vim-plug for several vim plugins but this is the first time I have encountered the need for this with zsh plugins. If this is something that other plugins would need as well, would you consider adding this ability to antidote?

mattmc3 commented 1 year ago

Yes - tracking it here: https://github.com/mattmc3/antidote/issues/12