1 stable release
new 1.0.0 | Oct 29, 2024 |
---|
#1548 in Command line utilities
117 downloads per month
38KB
894 lines
gitweb-release-downloader
Allows you to download release assets from GitHub and Gitea (thus Forgejo is
supported, too) and GitLab.
Additionally you can query a repository's releases and their respective assets.
Usage
Downloading VSCodium:
grd download "github.com/VSCodium/vscodium" "\\.deb$"
Alternatively:
grd download --website-type github "VSCodium/vscodium" "\\.deb$"
First argument is the repository
Second argument is a regex pattern for the asset to download
--website-type
takes the type of git website (if this is omitted, the program
tries to guess it from the passed repository, "github.com" and "gitlab.com" can
currently be guessed).
Downloading from the latest release of Forgejo on codeberg.org:
grd download --website-type gitea codeberg.org/forgejo/forgejo ".*"
It automatically takes the latest release, which is not a prerelease.
Alternatively it takes a tag to download with --tag
.
If you want to allow prereleases (or upcoming releases for GitLab) add
--prerelease
.
You can also make the program print the downloaded file name and pipe it to
another program or save it in a variable.
This for example allows automatic installation:
filename=$(grd download "github.com/VSCodium/vscodium" "\\.deb$" --print-filename)
sudo apt install "./$filename" && rm "$filename"
To query releases of a repository:
grd query releases "github.com/VSCodium/vscodium"
By default it will only print the latest release, which is not a prerelease.
You can change this with the --count
and --prerelease
flag.
To query assets of a repository:
grd query assets "github.com/VSCodium/vscodium"
By default this will print all assets of the latest release, which is not a
prerelease.
To query from a specific release you can use the --tag
flag (including
prereleases).
Limiting the assets to show is done with the --asset-pattern
flag.
Dependencies
~8–17MB
~235K SLoC