Skip to content

Instantly share code, notes, and snippets.

@trmaphi
Last active April 17, 2020 17:47
Show Gist options
  • Save trmaphi/317ca78158b93b951e80fa7e39c5f0f2 to your computer and use it in GitHub Desktop.
Save trmaphi/317ca78158b93b951e80fa7e39c5f0f2 to your computer and use it in GitHub Desktop.
Kitematic install script for Ubuntu
#!/usr/bin/env bash
set -v -e
BASEDIR=$(dirname "$0")
echo "$BASEDIR"
# Get link for latest release .deb package
URL=$(curl -s "https://api.github.com/repos/docker/kitematic/releases/latest" | grep browser_download_url | grep Ubuntu | cut -d '"' -f 4)
ZIPFILE=$(basename "${URL}")
curl --fail -LO "$URL" --output "${BASEDIR}/${ZIPFILE}"
# Version and package name
VERSION=${ZIPFILE%"Ubuntu.zip"}
PACKNAME=$(echo "${VERSION//-/_}")amd64.deb
#unzip and remove zip file
unzip "$ZIPFILE" && rm "$ZIPFILE"
#install and remove
cd dist && sudo dpkg -i "$PACKNAME" && cd .. && rm -rf dist
@connectwise-patrick-masters
Copy link

connectwise-patrick-masters commented Apr 17, 2020

Hey! Saw this on reddit, this got me started, but i ran into a few issues (no dist directory, a few other errors (like the name didn't match the file, and i'm not a fan of all the cd'ing around)
here's what i ended up w/

#!/usr/bin/env bash
set -e

# Get link for latest release .deb package
URL=$(curl -s "https://api.github.com/repos/docker/kitematic/releases/latest" | grep browser_download_url | grep Ubuntu | cut -d '"' -f 4)
ZIPFILE=$(basename "${URL}")
curl --fail -LO "$URL" --output $ZIPFILE

# Version and package name
VERSION=${ZIPFILE%"-Ubuntu.zip"}
PACKNAME=${VERSION}_amd64.deb

#unzip and remove zip file
unzip "$ZIPFILE" && rm "$ZIPFILE"

#install and remove
sudo dpkg -i $PACKNAME && rm $PACKNAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment