Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve binary name detection for --upgrade-only #32

Closed
dufferzafar opened this issue May 29, 2022 · 1 comment
Closed

Improve binary name detection for --upgrade-only #32

dufferzafar opened this issue May 29, 2022 · 1 comment

Comments

@dufferzafar
Copy link
Contributor

dufferzafar commented May 29, 2022

Thanks for --upgrade-only. It's a step in the right direction.

However it fails to work when the last component of the repo is different from the binary name.

Case in point:

❯ agrind --version
ag 0.18.0

❯ ls -lah agrind
-rwxr-xr-x 1 szafar infra 140M May 29 20:15 agrind

# The binary is already latest, but eget starts downloading.

❯ eget --upgrade-only rcoh/angle-grinder -a musl
https://github.com/rcoh/angle-grinder/releases/download/v0.18.0/agrind-x86_64-unknown-linux-musl.tar.gz

# This is because it is trying to find a binary called "angle-grinder", which doesn't exist.

# At first I thought, -f would work, but it doesn't
❯ eget --upgrade-only rcoh/angle-grinder -a musl -f agrind
https://github.com/rcoh/angle-grinder/releases/download/v0.18.0/agrind-x86_64-unknown-linux-musl.tar.gz

And now that I think about it, -f should not be used for this functionality.

We could use another switch for it perhaps? -b isn't used yet, -a for asset, -b for binary?

This would help in cases where we rename binaries from the packages, for eg. releases of GDU: https://github.com/dundee/gdu/ usually have binaries with long name like: gdu_linux_amd64_static, which I manually rename to gdu via mv gdu* gdu.

So, I guess for eget, something like this should work: eget --upgrade-only dundee/gdu -a static -b gdu

dufferzafar pushed a commit to dufferzafar/eget that referenced this issue May 29, 2022
Fixes zyedidia#32

Change-Id: I57a0af3f073be86f68cace904449ec2c87231545
dufferzafar added a commit to dufferzafar/eget that referenced this issue May 29, 2022
dufferzafar added a commit to dufferzafar/eget that referenced this issue May 30, 2022
dufferzafar added a commit to dufferzafar/eget that referenced this issue Jul 22, 2022
@dufferzafar
Copy link
Contributor Author

This can be achieved by using --to with --upgrade-only

eget --upgrade-only rcoh/angle-grinder -a musl -f agrind --to agrind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant