z-shell / zi

✨ A Swiss Army Knife for Zsh - Unix Shell
https://wiki.zshell.dev
MIT License
750 stars 42 forks source link

[bug]: patch/dl annex not working anymore #241

Closed niflostancu closed 2 years ago

niflostancu commented 2 years ago

Environment

Arch Linux, zsh 5.9

Reproduction steps

I am trying to install FZF + extras using the snippet there: https://wiki.zshell.dev/community/gallery/collection/programs#gh-r-junegunnfzf--extras

It doesn't work anymore :(

Expected behavior

Installation results (working state):

Downloading: junegunn/fzf…
(Requesting `fzf-0.35.0-linux_amd64.tar.gz'…)
####################################################################################################################################################################### 100.0%
ziextract: Unpacking the files from: `fzf-0.35.0-linux_amd64.tar.gz'…
ziextract: Successfully extracted and assigned +x chmod to the file: `fzf'
patch-dl annex: File _fzf_completion downloaded correctly
patch-dl annex: File key-bindings.zsh downloaded correctly
patch-dl annex: File fzf-tmux.1 downloaded correctly
patch-dl annex: File fzf.1 downloaded correctly
bin-gem-node-annex: Created the fzf shim and set {auto}`+x` on the fzf binary
Installed 0 completions. They are stored in $INSTALLED_COMPS array.

Current behavior

Results in:

Downloading: junegunn/fzf…
(Requesting `fzf-0.35.0-linux_amd64.tar.gz'…)
####################################################################################################################################################################### 100.0%
ziextract: Unpacking the files from: `fzf-0.35.0-linux_amd64.tar.gz'…
ziextract: Successfully extracted and assigned `+x` chmod to the file: `fzf'
bin-gem-node-annex: Created the fzf shim and set `+x` on the fzf binary
.zi-load-plugin:source:90: no such file or directory: /home/niflo/.cache/zconfig/plugins/junegunn---fzf/key-bindings.zsh
zsh-syntax-highlighting: unhandled ZLE widget 'fzf-history-widget'

The other annexes work, but the dl'...' hook doesn't run (nothing printed). Worked beautifully until I upgraded today.


### Code snippet

```sh
# Annexes
zi light z-shell/z-a-bin-gem-node
zi light z-shell/z-a-patch-dl
zi light z-shell/z-a-submods
# FZF + widgets
zi for from'gh-r' \
    dl'https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh -> _fzf_completion' \
    dl'https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh -> key-bindings.zsh' \
    dl'https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf-tmux.1 -> $ZI[MAN_DIR]/man1/fzf-tmux.1' \
    dl'https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf.1 -> $ZI[MAN_DIR]/man1/fzf.1' \
    id-as'junegunn/fzf' nocompile pick'/dev/null' sbin'fzf' src'key-bindings.zsh' \
      junegunn/fzf

Additional information

Since commit #25a22 it doesn't work anymore (I bisected it).

Self-service

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

No response

ss-o commented 2 years ago

Hi, @niflostancu could you provide the output of echo $ZI[CACHE_DIR], echo $ZSH_CACHE_DIR and echo $XDG_CACHE_DIR.

niflostancu commented 2 years ago

Hello, I think you meant XDG_CACHE_HOME, here you go:

➜ echo '|' $ZI[CACHE_DIR] '|' $ZSH_CACHE_DIR '|' $XDG_CACHE_HOME
| | ~/.cache/zconfig | ~/.cache

Oh, yes, I recall, I added this to my zsh config:

typeset -Ag ZI
export ZI[HOME_DIR]="$ZSH_CACHE_DIR"
export ZI[BIN_DIR]="${ZI[HOME_DIR]}/bin"
ss-o commented 2 years ago

Thanks for pointing this out :+1: A fix has been applied. Please update Zi, reload the shell, and re-open if the issue persists :dart:

niflostancu commented 2 years ago

That was quick. Thanks, it works now ;)

github-actions[bot] commented 1 year ago

Issue closed and locked due to lack of activity. If you encounter this same issue, please open a new issue and refer to this closed one.