2020-12-18 20:41:31 +03:00
|
|
|
#!/bin/bash -e -o pipefail
|
2023-11-28 02:25:03 +01:00
|
|
|
################################################################################
|
|
|
|
|
## File: install-swiftlint.sh
|
|
|
|
|
## Desc: Install SwiftLint
|
|
|
|
|
################################################################################
|
|
|
|
|
|
2020-12-18 20:41:31 +03:00
|
|
|
source ~/utils/utils.sh
|
|
|
|
|
|
2024-01-09 14:47:31 +01:00
|
|
|
echo "Installing Swiftlint..."
|
2023-02-13 16:40:48 +01:00
|
|
|
if is_BigSur; then
|
2023-07-25 15:16:35 +02: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
|
|
|
|
|
COMMIT=d1d5743344227fe6e3c37cfba19f0cfe15a9448a
|
|
|
|
|
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/swiftlint.rb"
|
|
|
|
|
|
2024-01-09 14:47:31 +01:00
|
|
|
curl -fsSL $FORMULA_URL > $(find $(brew --repository) -name swiftlint.rb)
|
2023-07-25 15:16:35 +02:00
|
|
|
HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_FROM_API=1 brew install swiftlint
|
2022-08-28 18:11:59 +03:00
|
|
|
else
|
2023-07-25 15:16:35 +02:00
|
|
|
brew_smart_install "swiftlint"
|
2022-08-28 18:11:59 +03:00
|
|
|
fi
|
|
|
|
|
|
2021-01-22 09:26:28 +03:00
|
|
|
invoke_tests "Linters" "SwiftLint"
|