ghdl is a fast and simple program (and also a golang module) for downloading and installing executable binary from github releases.
The demo above extracts
fd execuable to current working directory and give execute permission to it.
Auto decompressing and unarchiving the downloaded asset (without any system dependencies like
Currently supporting unarchiving `tar` and decompressing `zip` `gzip`. Package format `deb` `rpm` `apk` will be downloaded directly
ghdlbinary is statically linked, works well on non-FHS *nix systems like NixOS). In case this is relevant to you, on that kind of system, only binaries like
ghdlcan be run directly.
Setups for executable:
ghdlmoves executable to specified location and add execute permissions to the file.
Auto filtering: multiple assets in one release will be filtered by OS or ARCH. This feature can be disabled using
Interactive TUI: when auto filtering is failed or returned multiple options, you can select assets in a interactive way, with vim key bindings support.
ghdldownloads latest release by default, other or old tagged releases can be downloaded by specifying release tag:
Inspect download status with real-time progress bar.
If you’re going to use
ghdlas a go module, ignore the following installation progress.
Using Go tools:
go will download the latest version of ghdl to $GOPATH/bin, please make sure $GOPATH is in the PATH:
go install github.com/beetcb/ghdl/[email protected]
Note: Just to be safe, you’d better specify CGO_ENABLED=0 when running
go installon non-FHS *nix systems like NixOS)
Download and run executable from release.
Run the following shell script(*nix system only):
curl -fsSL "https://bina.egoist.sh/beetcb/ghdl?dir=/usr/local/bin" | sh # feel free to change the `dir` url param to specify the installation directory.
❯ ghdl --help ghdl download binary from github release ghdl handles archived or compressed file as well Usage: ghdl <user/repo[#tagname]> [flags] Flags: -F, --filter-off turn off auto-filtering feature -h, --help help for ghdl -n, --name string specify binary file name to enhance filtering and extracting accuracy -p, --path path save binary to path and add execute permission to it (default ".")
It’s tedious to specify
-p manually, we can alias
ghdl -p "$DirInPath" to a shorthand command, then use it as a executable installer.
go get github.com/beetcb/ghdl
ghdl‘s out-of-box utilities: see TestDownloadFdBinary func as an example
Licensed under MIT
Author: @beetcb | Email: [email protected]