Skip to content
/ har Public
forked from sio2boss/har

Download the url and unpack it if and as necessary.

License

Notifications You must be signed in to change notification settings

bioduck/har

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

har

From the Swedish verb 'to have'. We as developers and end users often download some file and then do some operation like extract it or install it or run it. Har's goal is to just do all that from a single tool. If you look at say a Dockerfile or Ansible or a Bash shell script, most of them have to figure out what compression was used and/or keep track of the filename used. These are core problems we will address.

Quick Install Instructions

This is the best way other folks on github have figured out how to download a golang based binary and install it.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/sio2boss/har/master/tools/install.sh)"

or if you already have har installed and want the update

har i -y https://raw.githubusercontent.com/sio2boss/har/master/tools/install.sh

Modes

Mode Description
i Download and install script
b Download and install binary file to /usr/local/bin
g Just Download
x Download and extract

Use-Cases

Download Stuff

Just grab files from the web and extract them, remove the archive. This simplifies the av-shell binary install too

example usage:

har x --silent https://github.com/BVLC/caffe/archive/rc3.zip
har x https://github.com/sio2boss/av-shell/releases/download/2.1.0/av-shell-2.1.0-linux64.tar.gz -C ~/

or if you dont want to automatically extract:

har g https://github.com/BVLC/caffe/archive/rc3.zip

Install Stuff

There are a ton of examples on the internet where you download a file with curl and then run the script afterwards…brew, kops, av-shell. But also there are apps that you just download and copy to /usr/local/bin and chmod like mc, kubectl, etc...

for the download, chmod, and move to /usr/local/bin style:

har b https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
har b --sha1=d604417c2efba1413e2441f16de3be84d3d9b1ae https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl
har b https://dl.min.io/client/mc/release/darwin-amd64/mc

for the run a script style:

har i https://raw.githubusercontent.com/sio2boss/har/master/tools/install.sh
har i -—ruby https://raw.githubusercontent.com/Homebrew/install/master/install

About

Download the url and unpack it if and as necessary.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 82.8%
  • Shell 10.7%
  • Makefile 6.5%