[macOS] Install swiftlint from Homebrew (#7912)
This commit is contained in:
@@ -1,19 +1,16 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
|
|
||||||
echo "Install SwiftLint"
|
echo Installing Swiftlint...
|
||||||
# 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
|
|
||||||
if is_BigSur; then
|
if is_BigSur; then
|
||||||
version="0.48.0"
|
# 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
|
||||||
|
COMMIT=d1d5743344227fe6e3c37cfba19f0cfe15a9448a
|
||||||
|
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/swiftlint.rb"
|
||||||
|
|
||||||
|
curl -fsSL "$FORMULA_URL" > $(find $(brew --repository) -name swiftlint.rb)
|
||||||
|
HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_FROM_API=1 brew install swiftlint
|
||||||
else
|
else
|
||||||
version="latest"
|
brew_smart_install "swiftlint"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
swiftlintUrl=$(get_github_package_download_url "realm/SwiftLint" "contains(\"portable_swiftlint.zip\")" "$version" "$API_PAT")
|
|
||||||
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"
|
invoke_tests "Linters" "SwiftLint"
|
||||||
|
|||||||
Reference in New Issue
Block a user