diff options
| author | Ben Beltran <ben@nsovocal.com> | 2017-05-20 09:52:30 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2017-05-20 09:52:30 -0500 |
| commit | ee966aa755acd8eea53c982e43e13aef4f193984 (patch) | |
| tree | 5df111da5948ea198c5db1ca8f62e6c6ebe51178 /Scripts/install_swiftlint.sh | |
| parent | bcd37f402a2586d051ac10a6a4982c8c226b2cce (diff) | |
| parent | 0d4485a445dd387235c141afca7764481eac0311 (diff) | |
Merge branch 'release/0.1.0'0.1.0
Diffstat (limited to 'Scripts/install_swiftlint.sh')
| -rwxr-xr-x | Scripts/install_swiftlint.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Scripts/install_swiftlint.sh b/Scripts/install_swiftlint.sh new file mode 100755 index 0000000..6a2f250 --- /dev/null +++ b/Scripts/install_swiftlint.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Taken from: https://alexplescan.com/posts/2016/03/03/setting-up-swiftlint-on-travis-ci/ + +# Installs the SwiftLint package. +# Tries to get the precompiled .pkg file from Github, but if that +# fails just recompiles from source. + +set -e + +SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg" +SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.18.1/SwiftLint.pkg" + +wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL + +if [ -f $SWIFTLINT_PKG_PATH ]; then + echo "SwiftLint package exists! Installing it..." + sudo installer -pkg $SWIFTLINT_PKG_PATH -target / +else + echo "SwiftLint package doesn't exist. Compiling from source..." && + git clone https://github.com/realm/SwiftLint.git /tmp/SwiftLint && + cd /tmp/SwiftLint && + git submodule update --init --recursive && + sudo make install +fi |