casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
17.59k stars 399 forks source link

Remove version number from release assets to make auto-install scripts a little easier? #2003

Open alshdavid opened 1 month ago

alshdavid commented 1 month ago

Currently to grab the latest just binary you have to query the GitHub releases API for the just repo, lookup the binary name associated with your platform before downloading it.

Would you consider changing the release asset names to omit the version number so the API lookup could be avoided?

This would allow auto-download scripts to use:

wget https://github.com/casey/just/releases/download/latest/just-aarch64-apple-darwin.tar.gz

Rather than

wget https://github.com/casey/just/releases/download/1.25.2/just-1.25.2-aarch64-apple-darwin.tar.gz
casey commented 1 month ago

I'd definitely consider it. Is it common practice? I personally like having the version number in the release archive name, so you can, for example, download multiple to the same directory.

And there's always the install script:

curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s
VladimirMarkelov commented 1 month ago

I do not think it is common practice. I checked a few very popular apps (e.g, nu/bat/delta). They all add version to the archive name.

Besides loosing the mentioned feature - download a few different version into the same directory, removing version URL may break existing scripts of other people. As I mentioned in another thread, e.g, Windows package managers like scoop can be hurt by this change.

If you mark the last release "latest", it is accessible with the link https://github.com/casey/just/releases/latest - it automatically redirects the release marked "latest". I am not sure how to download this way in script. Maybe, get redirect URL and extract version number in script?

Edit: checked that URL https://github.com/nushell/nushell/releases/latest works fine at this moment.

alshdavid commented 1 month ago

That's okay, appreciate the consideration.

Given the filename includes the version you still need to query the contents of the URL to determine the package name to download (even with the latest tag in the URL).

This means that rather than an install being a simple one line curl | tar -C $HOME/.local/just, the install script would depend on jq, which adds a hurdle for Windows scripts that have to be a bit more spartan.

hustcer commented 1 month ago

1956

woutervh commented 3 weeks ago

https://github.com/casey/just/issues/2006 would fix the same problem in a different way.

alshdavid commented 3 weeks ago

That would help with updating an existing install, but not with fresh installs - right?