Skip to content

Instantly share code, notes, and snippets.

@pabl0rg
Last active March 2, 2017 22:10
Show Gist options
  • Save pabl0rg/a17fb4c8c3c3b57eb2833f2125c2b502 to your computer and use it in GitHub Desktop.
Save pabl0rg/a17fb4c8c3c3b57eb2833f2125c2b502 to your computer and use it in GitHub Desktop.
type jq >/dev/null 2>&1 || { echo >&2 "I require jq but it's not installed. Aborting."; exit 1; }
LATEST_KOBALT_URL=`curl -s https://api.github.com/repos/cbeust/kobalt/releases/latest | jq -r ".assets[0] | .browser_download_url" `
LATEST_KOBALT_ZIP=`echo "$LATEST_KOBALT_URL" | rev | cut -d / -f 1 | rev`
LATEST_KOBALT=`echo "$LATEST_KOBALT_ZIP" | sed 's/.zip//'`
if [ ! -d ~/.kobalt/wrapper/dist/$LATEST_KOBALT ]; then
mkdir -p ~/.kobalt/wrapper/dist/
cd ~/.kobalt/wrapper/dist/
curl -LO $LATEST_KOBALT_URL
unzip -o $LATEST_KOBALT_ZIP
fi
chmod +x ~/.kobalt/wrapper/dist/$LATEST_KOBALT/bin/kobaltw
~/.kobalt/wrapper/dist/$LATEST_KOBALT/bin/kobaltw --update .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment