ccmywish / ghcurl

Download files and install from Github releases

Home Page:https://rubygems.org/gems/ghcurl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ghcurl

Gem Version

Download files and install from Github releases.

It works on Linux, Windows, macOS and maybe other OSes.

gem install ghcurl

ghcurl can recognize your OS and arch, give you the proper option to download. You can search by regular expression, specify a version, and install it to a path or according to the environment variable GHCURL_BIN_PATH or just /usr/local/bin. It will automatically extract a tar/zip file to make the installation process better.


Usage

$ ghcurl [user/]repo [regexp] [options]

-o

This is optional, download will default to ~/.cache/ghcurl

  1. -o path Download into path
  2. -o path/name Download as path/name

-v

  1. -v 1.0.0 Download tag version 1.0.0
  2. -v3.1.4 This is also OK to download tag version 3.1.4

-i

  1. -i Install to /usr/local/bin or GHCURL_BIN_PATH
  2. -i path Install to path

-r

  1. -r name Install the binary as name

Example

Things can be easier. We consider these as popular binaries: https://github.com/ibraheemdev/modern-unix

Notice: -i means to install.

# It knows that's sharkdp/fd
ghcurl fd -i

# It's cli/cli !
ghcurl gh -i

# Much easier to install rbspy!
ghcurl rbspy -i

Download latest deb/rpm package and install, notice the argument deb / rpm are just regular expressions.

ghcurl cli/cli deb -i
ghcurl cli/cli rpm -i

Normal download

# The easiest way to download
ghcurl gh

# Download to /tmp
ghcurl gh -o /tmp

# Download latest rbspy-x86_64-unknown-linux-gnu.tar.gz to ~/.cache/ghcurl
ghcurl rbspy/rbspy 'x86_64.*linux'

# Download rbspy version 0.11.1 
ghcurl rbspy/rbspy 'x86_64.*linux' -v0.11.1

Download a binary and install it to anywhere

# Install to /usr/local/bin
ghcurl starship linux-gnu -i 

# Install to ~/tmp/bin
ghcurl BetaPictoris/timeleft -i ~/tmp/bin

# Download as /tmp/github-cli and install
ghcurl gh -o /tmp/github-cli -i

# Install and rename it to, here, 'tldr' in /usr/local/bin
ghcurl dbrgn/tealdeer x86_64 -i -r 'tldr'

# or, like this
ghcurl dlvhdr/gh-dash linux-amd64 -i ~/tmp/bin/gd

About

Download files and install from Github releases

https://rubygems.org/gems/ghcurl

License:MIT License


Languages

Language:Ruby 99.1%Language:Shell 0.9%