Change installation method to portable (#4967)

This commit is contained in:
Mikhail Timofeev
2022-01-28 21:08:32 +03:00
committed by GitHub
parent e5d8f5af5c
commit f09c8ab9f2

View File

@@ -2,9 +2,11 @@
source ~/utils/utils.sh
echo "Install SwiftLint"
swiftlintUrl=$(curl -H "Authorization: token $API_PAT" -s "https://api.github.com/repos/realm/SwiftLint/releases/latest" | jq -r '.assets[].browser_download_url | select(contains("SwiftLint.pkg"))')
download_with_retries $swiftlintUrl "/tmp" "SwiftLint.pkg"
sudo installer -pkg /tmp/SwiftLint.pkg -target /
rm -rf /tmp/SwiftLint.pkg
swiftlintUrl=$(curl -H "Authorization: token $API_PAT" -s "https://api.github.com/repos/realm/SwiftLint/releases/latest" | jq -r '.assets[].browser_download_url | select(contains("portable_swiftlint.zip"))')
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"
invoke_tests "Linters" "SwiftLint"