zdharma-continuum / zinit-annex-patch-dl

Unmaintained mirror of zinit-zsh/z-a-patch-dl
MIT License
3 stars 6 forks source link

[bug]: fails to install fzf additonal files #16

Open jankatins opened 7 months ago

jankatins commented 7 months ago

Describe the bug

Since a few weeks, it fails to install the additional files which I want to install together with fzf.

I hunted it down to this change:

- srcdst=( ${srcdst[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/} )
+ srcdst=(${${srcdst[@]##[[:blank:]]##}%%[[:blank:]]##})

In https://github.com/zdharma-continuum/zinit-annex-patch-dl/commit/71218022d9d75b7e4a1e75ba9054f2c4e3a5b013

If I use the old version, it works, if I use the new version, I get an error. Given that I've neither an idea what the old version does nor the new version, I abstain from making a PR for just reverting this line.

Steps to reproduce

zinit lbin'!' completions \
    dl'https://raw.githubusercontent.com/junegunn/fzf/master/bin/fzf-tmux;
       https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh -> _fzf_completion;
       https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh;
       https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf-tmux.1 -> $ZPFX/man/man1/fzf-tmux.1;
       https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf.1 -> $ZPFX/man/man1/fzf.1' \
    src"key-bindings.zsh" \
    for @junegunn/fzf

Run zinit update to get all the latest versions (Might already observe the below problems in case fzf gets updated).

Run zinit delete junegunn/fzf -y && exec zsh

Expected behavior

All the nice additional files are installed.

Screenshots and recordings

Bad behaviour:

λ  zinit delete junegunn/fzf -y && exec zsh
==> linkbin: Deleted fzf soft link
==> Uninstalled junegunn/fzf

Downloading junegunn/fzf…

(Requesting `fzf-0.45.0-linux_amd64.tar.gz'…)
####################################################################################################################################################################################### 100.0%
[ziextract] Unpacking the files from: `fzf-0.45.0-linux_amd64.tar.gz'…
[ziextract] Successfully extracted and assigned +x chmod to the file: fzf.
==> patch-dl: fzf-tmux downloaded successfully
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh
\$ZPFX/man/man1/fzf-tmux.1"
\$ZPFX/man/man1/fzf-tmux.1"
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf-tmux.1
\$ZPFX/man/man1/fzf.1"
\$ZPFX/man/man1/fzf.1"
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf.1
==> linkbin: Created fzf soft link & set +x on the fzf binary
==> Installed 1 completion

With the old line:

λ  zinit delete junegunn/fzf
==> Delete junegunn/fzf? [y/N]: y
==> linkbin: Deleted fzf soft link
==> Uninstalled junegunn/fzf

λ  exec zsh

Downloading junegunn/fzf…

(Requesting `fzf-0.45.0-linux_amd64.tar.gz'…)
####################################################################################################################################################################################### 100.0%
[ziextract] Unpacking the files from: `fzf-0.45.0-linux_amd64.tar.gz'…
[ziextract] Successfully extracted and assigned +x chmod to the file: fzf.
==> patch-dl: fzf-tmux downloaded successfully
==> patch-dl: _fzf_completion downloaded successfully
==> patch-dl: key-bindings.zsh downloaded successfully
\$ZPFX/man/man1/fzf-tmux.1"
\$ZPFX/man/man1/fzf-tmux.1"
==> patch-dl: fzf-tmux.1 downloaded successfully
\$ZPFX/man/man1/fzf.1"
\$ZPFX/man/man1/fzf.1"
==> patch-dl: fzf.1 downloaded successfully
==> linkbin: Created fzf soft link & set +x on the fzf binary
==> Installed 1 completion

Operating System & Version

linux-gnu | debian | x86_64 | x86_64 | x86_64 unknown

Zsh version

zsh 5.9 (x86_64-debian-linux-gnu

Terminal emulator

wezterm

If using WSL on Windows, which version of WSL

None

Additional context

No response

ngocphamm commented 7 months ago

I did notice this issue as well, and I figured it was the way I have all the files in one dl block. Changing to each file in one dl line makes it work, but I do like the old way better just like @jankatins.

jankatins commented 7 months ago

Just FYI: I don't care one way or the other, just that this is a recipe which I c&p'ed from somewhere, so apparently it's somewhat know that this should work.

I didn't even know you can use dl multiple times :-)

ngocphamm commented 7 months ago

Yeah I think I misread your message and thought you like the big block dl way better.