]> git.r.bdr.sh - rbdr/lyricli/blame - Scripts/install_sourcekitten.sh
Update the Version
[rbdr/lyricli] / Scripts / install_sourcekitten.sh
CommitLineData
892c577e
BB
1#!/bin/bash
2
3# Taken from: https://alexplescan.com/posts/2016/03/03/setting-up-swiftlint-on-travis-ci/
4# And adapted for sourcekitten
5
6# Installs the SourceKitten package.
7# Tries to get the precompiled .pkg file from Github, but if that
8# fails just recompiles from source.
9
10set -e
11
12SOURCEKITTEN_PKG_PATH="/tmp/SourceKitten.pkg"
13SOURCEKITTEN_PKG_URL="https://github.com/jpsim/SourceKitten/releases/download/0.17.3/SourceKitten.pkg"
14
15wget --output-document=$SOURCEKITTEN_PKG_PATH $SOURCEKITTEN_PKG_URL
16
17if [ -f $SOURCEKITTEN_PKG_PATH ]; then
18 echo "SourceKitten package exists! Installing it..."
19 sudo installer -pkg $SOURCEKITTEN_PKG_PATH -target /
20else
21 echo "SourceKitten package doesn't exist. Compiling from source..." &&
22 git clone https://github.com/jspim/SourceKitten.git /tmp/SourceKitten &&
23 cd /tmp/SourceKitten &&
24 sudo make install
25fi