]> git.r.bdr.sh - rbdr/lyricli/blame_incremental - Scripts/install_swiftlint.sh
Include iTunes in default sources
[rbdr/lyricli] / Scripts / install_swiftlint.sh
... / ...
CommitLineData
1#!/bin/bash
2
3# Taken from: https://alexplescan.com/posts/2016/03/03/setting-up-swiftlint-on-travis-ci/
4
5# Installs the SwiftLint package.
6# Tries to get the precompiled .pkg file from Github, but if that
7# fails just recompiles from source.
8
9set -e
10
11SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
12SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.18.1/SwiftLint.pkg"
13
14wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL
15
16if [ -f $SWIFTLINT_PKG_PATH ]; then
17 echo "SwiftLint package exists! Installing it..."
18 sudo installer -pkg $SWIFTLINT_PKG_PATH -target /
19else
20 echo "SwiftLint package doesn't exist. Compiling from source..." &&
21 git clone https://github.com/realm/SwiftLint.git /tmp/SwiftLint &&
22 cd /tmp/SwiftLint &&
23 git submodule update --init --recursive &&
24 sudo make install
25fi