Skip to content

Instantly share code, notes, and snippets.

@jpillora
Created March 29, 2015 08:46
Show Gist options
  • Save jpillora/5a7da6a297d2b6c33d04 to your computer and use it in GitHub Desktop.
Save jpillora/5a7da6a297d2b6c33d04 to your computer and use it in GitHub Desktop.
Download binary release from Github
#!/bin/bash
function download {
EXEC=$1
GH="https://github.com/jpillora/$EXEC"
VERSION=`curl -sI $GH/releases/latest | grep Location | grep -m 1 -o '\d\+\.\d\+\.\d\+'`
DIR="chisel_$(echo -n $VERSION)_linux_amd64"
URL="$GH/releases/download/$VERSION/$DIR.tar.gz"
curl -sL $URL | tar zxvf -
cp $DIR/$EXEC .
rm -r $DIR
}
download "chisel"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment