zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.72k stars 122 forks source link

[bug]: Picks wrong atuin binary #659

Open jankatins opened 2 weeks ago

jankatins commented 2 weeks ago

What happened?

I want to install atuin via zinit

zinit default-ice --quiet as'null' from"gh-r" lbin'!' lucid nocompile completions
zinit mv""atuin*/atuin -> atuin"" lbin"!atuin -> atuin" \
     atclone'./atuin init zsh --disable-up-arrow >> zhook.zsh && ./atuin gen-completions --shell zsh > _atuin' atpull'%atclone' \
     src="zhook.zsh" wait'0b' lucid  \
     atload'ZSH_AUTOSUGGEST_STRATEGY=(atuin);_zsh_autosuggest_strategy_atuin() { typeset -g suggestion; suggestion="$(atuin search --limit 1 --search-mode prefix --cmd-only "$1")"; }' for \
   @atuinsh/atuin

This recipe, on my mac x86 laptop, downloads a *-update file instead of the correct atuin*.tar.gz file from the current release: https://github.com/atuinsh/atuin/releases/tag/v18.3.0:

λ  exec zsh

==> Downloading atuinsh/atuin
==> Requesting atuin-x86_64-apple-darwin-update
######################################################################################################################################################################################################################################################### 100.0%
[ziextract] Successfully extracted and assigned +x chmod to the file: atuin-x86_64-apple-darwin-update.
atuin-x86_64-apple-darwin-update -> atuin
error: unexpected argument 'init' found

Usage: atuin [OPTIONS]

For more information, try '--help'.
Warning: ∞zinit-atclone-hook hook returned with 2
==> linkbin: Created atuin soft link & set +x on the atuin binary

Thankfully, an additional bpick"atuin-*.tar.gz" fixed it.

Steps to reproduce

  1. Execute above recipe
  2. Notice the wrongly downloaded file

Operating System & Version

OS: darwin21.3.0 | Vendor: apple | Machine: x86_64 | CPU: x86_64 | Processor: i386 | Hardware: x86_64

Zsh version

zsh 5.9 (x86_64-apple-darwin21.3.0)

Terminal emulator

wezterm

Code of Conduct

vladdoster commented 2 weeks ago

@jankatins, This is an edge-case where I can't think of a fix that would improve odds of correct binary selection.

FWIW, bpick ice can be reduced to a*z.

Screenshot 2024-06-13 at 22 46 07