jpillora / installer

One-liner for installing binaries from Github releases
https://i.jpillora.com/installer
MIT License
199 stars 52 forks source link

feat: support multiple binaries from one link #40

Open cxjava opened 8 months ago

cxjava commented 8 months ago

Such as https://github.com/xtaci/kcptun, in this kcptun-linux-amd64-20231012.tar.gz release

Contains two binaries: server_darwin_amd64, client_darwin_amd64,

What I expected is : when I run this repository script, I can install those two binaries into the folder /usr/local/bin/.

jpillora commented 8 months ago

Ah interesting use case, doable, though it breaks a few assumptions. Like the as param, e.g. install ripgrep as rg - two/more binaries wouldn't work here. important here, because with your example, you might want them to be called kcptun-server and kcptun-client - that might be too hard to automatically do though...

Currently the logic treats the largest file (over 1MB) in the archive as the binary

If there's 2, and the tar has 100 files, how do you find the binaries? largest 2? all files over 1MB? do you use the file mode, anything thats marked executable? some people do chmod 777 everything

cxjava commented 8 months ago

Thank you for the response! Maybe this requirement is not so urgent.

onedr0p commented 6 months ago

I also have a use-case for this with https://github.com/siderolabs/talos/releases/tag/v1.6.2. I would like to only grab the talosctl artifact from these releases. Right now it only pulls talos which is not what I want.

Maybe there can be a filter arg like ?filter=talosctl&as=tctl that wrap a glob around it ?

Edit: this is not the same as what OP mentioned. I will open a new issue.