Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chmouel/gh-get-asset
GH extensions to get an asset from a release
https://github.com/chmouel/gh-get-asset
gh-extension git github shell-script
Last synced: 1 day ago
JSON representation
GH extensions to get an asset from a release
- Host: GitHub
- URL: https://github.com/chmouel/gh-get-asset
- Owner: chmouel
- License: apache-2.0
- Created: 2022-12-20T09:20:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-18T06:24:49.000Z (about 1 year ago)
- Last Synced: 2024-08-03T21:02:24.513Z (3 months ago)
- Topics: gh-extension, git, github, shell-script
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gh-cli-extensions - **get-asset** - Fetch an asset (ie: binary) from a GitHub release. (Github)
- jimsghstars - chmouel/gh-get-asset - GH extensions to get an asset from a release (Shell)
README
# gh-get-asset
Fetch an asset (ie: binary) from a GitHub release
## Installation
```shell
gh extension install chmouel/gh-get-asset
```### Requirements
- [GH](https://github.com/cli/cli)
- [JQ](https://stedolan.github.io/jq/)## Usage
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:
```console
gh get-asset chmouel/gosmee Linux-ARM64.rpm
```this will grab the latest release from
[gosmee](https://github.com/chmouel/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` :
```console
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.## Copyright
[Apache-2.0](./LICENSE)
## TODO
- Use gh token to grab releases/asset for private repos.
## Authors
Chmouel Boudjnah
- Fediverse - <[@[email protected]](https://fosstodon.org/@chmouel)>
- Twitter - <[@chmouel](https://twitter.com/chmouel)>
- Blog - <[https://blog.chmouel.com](https://blog.chmouel.com)>