Created
March 29, 2015 08:46
-
-
Save jpillora/5a7da6a297d2b6c33d04 to your computer and use it in GitHub Desktop.
Download binary release from Github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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