zyedidia / eget

Easily install prebuilt binaries from GitHub.
MIT License
959 stars 39 forks source link

select asset finds two candidates #10

Closed thorstenkampe closed 2 years ago

thorstenkampe commented 2 years ago

Projects often provide musl and standard (non-musl) packages. I would like to download the non-musl package but the asset string matches both (see below).

Is there a way to avoid prompting? Maybe by accepting a regular expression (like bat_.+amd64\.deb) for the matching string?

> eget --asset amd64.deb sharkdp/bat
2 candidates found for asset `amd64.deb`: please select manually
(1) bat-musl_0.18.3_amd64.deb
(2) bat_0.18.3_amd64.deb
zyedidia commented 2 years ago

I see the issue, it seems like having a regex option could work (I have this implemented on the rgxasset branch). Another option could be to allow --asset to be specified multiple times, each time filtering a little more. For example you could use --asset amd64.deb --asset musl. Not sure which solution is better at the moment.

thorstenkampe commented 2 years ago

--asset can already be specified multiple times - but it does the opposite. And it would not allow me to specify the "non-musl" version.

./eget --asset amd64.deb --asset musl sharkdp/bat
4 candidates found for asset `musl`: please select manually
(1) bat-musl_0.18.3_amd64.deb
(2) bat-musl_0.18.3_i686.deb
(3) bat-v0.18.3-i686-unknown-linux-musl.tar.gz
(4) bat-v0.18.3-x86_64-unknown-linux-musl.tar.gz
Enter selection number:
zyedidia commented 2 years ago

I think in the current version it will just use the asset value most recently specified, so in this case it is just finding all musl matches.

zyedidia commented 2 years ago

I have decided to go with filtering via multiple flags. The update has been merged, and --asset can now also be abbreviated to -a. I will make a new release later tonight.