File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ ANALYSIS=0
8
8
COMPILE=0
9
9
TEST=0
10
10
UPDATE_SESSION_REPLAY_PAYLOAD=0
11
+ KTLINT_VERSION=0.50.0
11
12
12
13
export CI=true
13
14
@@ -56,17 +57,34 @@ if [[ $SETUP == 1 ]]; then
56
57
echo " -- SETUP"
57
58
58
59
echo " ---- Install KtLint"
60
+ INSTALL_KTLINT=false
59
61
if [[ -x " $( command -v ktlint) " ]]; then
60
- echo " KtLint already installed; version $( ktlint --version) "
61
- else
62
- curl -SLO https://github.com/pinterest/ktlint/releases/download/0.50.0/ktlint && chmod a+x ktlint
62
+ INSTALLED_KTLINT=` ktlint --version`
63
+ echo " KtLint already installed; version $INSTALLED_KTLINT "
64
+ if [[ $INSTALLED_KTLINT != $KTLINT_VERSION ]]; then
65
+ echo " Upgrading to version $KTLINT_VERSION "
66
+ INSTALL_KTLINT=true
67
+ fi
68
+ fi
69
+
70
+ if [[ $INSTALL_KTLINT = true ]]; then
71
+ curl -SLO https://github.com/pinterest/ktlint/releases/download/$KTLINT_VERSION /ktlint && chmod a+x ktlint
63
72
sudo mv ktlint /usr/local/bin/
64
73
echo " KtLint installed; version $( ktlint --version) "
65
74
fi
66
75
76
+
77
+
67
78
echo " ---- Install Detekt"
68
79
if [[ -x " $( command -v detekt) " ]]; then
69
80
echo " Detekt already installed; version $( detekt --version) "
81
+ read -p " Would you like to update Detekt? " -n 1 -r
82
+ echo
83
+ if [[ $REPLY =~ ^[Yy]$ ]]
84
+ then
85
+ brew upgrade detekt
86
+ echo " Detekt upgraded; version $( detekt --version) "
87
+ fi
70
88
else
71
89
brew install detekt
72
90
echo " Detekt installed; version $( detekt --version) "
You can’t perform that action at this time.
0 commit comments