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

how to use --gh-release to install specified version? #2

Closed
aMOPel opened this issue Apr 5, 2023 · 2 comments
Closed

how to use --gh-release to install specified version? #2

aMOPel opened this issue Apr 5, 2023 · 2 comments

Comments

@aMOPel
Copy link

aMOPel commented Apr 5, 2023

shsh install --gh-release=0.38.0 junegunn/fzf

would still install the latest version (0.39.0).

Or is version pinning not support so far?

it would be a great feature.

@soraxas
Copy link
Owner

soraxas commented Apr 25, 2023

Hi @aMOPel

The --gh-release=xxxx is used when you want to disambiguate release asset name. For example, if the release contain two asset named as ABC and DEF, you can do

shsh install --gh-release=DEF my/repo

to pick the latter.


For your usecase, you can use

shsh install --gh-release junegunn/fzf@0.38.0

to pin the version (it can either be any ref, like a release tag or commit id).

You might need to first upgrade to the latest version, with

shsh self-upgrade

because the previous version was not respecting the ref tag.

I've updated usage on readme to explain this usage.

@aMOPel
Copy link
Author

aMOPel commented Apr 25, 2023

Thank you! I eventually figured it out after reading the code a little and forgot to close this. Sorry.

I ended up forking your repo and adding a few features I was missing. I didn't make a pr since my code is rather ad hoc, but feel free to take inspiration.

https://github.com/aMOPel/shsh

[parse repository and reference when using --plain]
without this, shsh install --gh-release junegunn/fzf@0.38.0 would not work correctly. I think it would always pull the latest version or fail all together.

[added automatic searching for bash completion files when linking completion]
[added support for relative paths, when passing -v MANS=<path>]
some issues I encountered with linking

[if after extracting assets, all files are in 1 sub directory, move them 1 up]
this was necessary, since linking would fail if the archive would extract into a subdirectory. Alternatively you could adapt your linking paths.

[made asset filter for "linux" case insesitive]
so it could actually find assets with names containing Linux etc

@aMOPel aMOPel closed this as completed Apr 25, 2023
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

No branches or pull requests

2 participants