Home

Awesome

ghdl

Memorize ghdl as github download

ghdl is a fast and simple program (and also a golang module) for downloading and installing executable binary from github releases.

<p align="center"> <img alt="animated demo" src="./demo.svg" width="600px"> </p> <p align="center"> <strong>The demo above extracts <code>fd</code> execuable to current working directory and give execute permission to it.</strong> </p>

Features

Installation

If you're going to use ghdl as a go module, ignore the following installation progress.

Usage

CLI

Run ghdl --help

❯ ghdl --help

ghdl download binary from github release
ghdl handles archived or compressed file as well

Usage:
  ghdl <user/repo[#tagname]> [flags]

Flags:
  -f, --asset-filter string   specify regular expression for the asset name; used in conjunction with the platform and architecture filters.
  -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 Module

  1. Require ghdl to go.mod

    go get github.com/beetcb/ghdl
    
  2. Use ghdl's out-of-box utilities: see TestDownloadFdBinary func as an example

Credit

Inspired by egoist/bina, TUI powered by charmbracelet/bubbletea

License

Licensed under MIT

Author: @beetcb | Email: i@beetcb.com