zdharma-continuum / zinit-annex-readurl

Other
5 stars 7 forks source link

[feat]: Possibility to search OS and Architecture #15

Open AntoinePrv opened 1 year ago

AntoinePrv commented 1 year ago

If the feature request is for a plugin or theme, specify it here.

zinit-annex-readurl

If the feature solves a problem you have, specify it here.

The %VERSION% token allow to search for latest version with zinit-annex-readurl. I wonder if it would be possible to automatically choose operating system and architecture among the links the way zinit does it for Github releases.

Describe the proposed feature.

Adding %OS% and %ARCHITECTURE% tokens to zinit-annex-readurl to pick the correct link when downloading binaries. I'm not sure how the matching could safely made (e.g. for MacOS, we have OSX, MacOS, Darwin...)

Describe alternatives you've considered

Doing the matching in user configuration files using uname. It's working solution but a bit verbose, especially when different URLs don't use the same naming conventions.

Additional context

No response

Related Issues

No response

vladdoster commented 1 year ago

This is something I've been wanting, too. Especially since gh-r correctly chooses system specific 99% of the time, so it would be nice to have functionality in readurl so it's just as easy to use.

Addressing your macOS concern, I'd just pull in the darwin gh-r logic.