Fetch an asset (ie: binary) from a GitHub release
gh extension install chmouel/gh-get-asset
gh get-asset extension let you download an asset (ie: binary or others) from a release page.
by default the first argument is the owner/repo
and second argument is a substring in the asset.
example:
gh get-asset chmouel/gosmee Linux-ARM64.rpm
this will grab the latest release from gosmee that has Linux-ARM64.rpm in the binary name.
If you want to output it to another file or location you can use -o
:
gh get-asset -o/tmp/gosmee.rpm chmouel/gosmee Linux-ARM64.rpm && rpm -Uvh /tmp/gosmee.rpm
If you have multiple binary matching it will get all of them (incompatible with -o option)
You can add -s
for silent te output of curl (useful for crons)
By default it will always grab the latest release unless you specify -r RELEASE
to grab another release.
- Use gh token to grab releases/asset for private repos.
Chmouel Boudjnah
- Fediverse - <@chmouel@fosstodon.org>
- Twitter - <@chmouel>
- Blog - <https://blog.chmouel.com>