2020-12-18 20:41:31 +03:00
|
|
|
#!/bin/bash -e -o pipefail
|
|
|
|
|
source ~/utils/utils.sh
|
|
|
|
|
|
|
|
|
|
echo "Install SwiftLint"
|
2022-08-28 18:11:59 +03:00
|
|
|
# SwiftLint now requires Swift 5.6 or higher to build, and macOS 12 or higher to run https://github.com/realm/SwiftLint/releases/tag/0.49.0
|
2023-02-13 16:40:48 +01:00
|
|
|
if is_BigSur; then
|
2022-08-28 18:11:59 +03:00
|
|
|
version="0.48.0"
|
|
|
|
|
else
|
|
|
|
|
version="latest"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
swiftlintUrl=$(get_github_package_download_url "realm/SwiftLint" "contains(\"portable_swiftlint.zip\")" "$version" "$API_PAT")
|
2022-01-28 21:08:32 +03:00
|
|
|
download_with_retries $swiftlintUrl "/tmp" "portable_swiftlint.zip"
|
|
|
|
|
unzip -q "/tmp/portable_swiftlint.zip" -d /usr/local/bin
|
|
|
|
|
# Remove the LICENSE file that comes along with the binary and the downloaded archive
|
|
|
|
|
rm -rf "/usr/local/bin/LICENSE"
|
|
|
|
|
rm -rf "/tmp/portable_swiftlint.zip"
|
2021-01-20 14:11:00 +07:00
|
|
|
|
2021-01-22 09:26:28 +03:00
|
|
|
invoke_tests "Linters" "SwiftLint"
|