File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+
3
+ set -e
4
+
2
5
if [[ " $DETEKT_VERSION " == " " ]]; then
3
6
echo " Privide detekt version in DETEKT_VERSION env variable"
4
7
exit 1
@@ -7,19 +10,22 @@ if [[ "$KTLINT_VERSION" == "" ]]; then
7
10
echo " Provide ktlint version in KTLINT_VERSION env variable"
8
11
exit 1
9
12
fi
10
- mkdir -p ${HOME} /.local/bin
13
+ TOOLS=" $( pwd) /tools"
14
+ mkdir -p ${TOOLS}
11
15
echo " Installing detekt $DETEKT_VERSION "
12
- jar_destination=" ${HOME} /.local /lib/detekt"
16
+ jar_destination=" ${TOOLS} /lib/detekt"
13
17
mkdir -p ${jar_destination}
14
18
curl -sSL -o ${jar_destination} /detekt-cli.jar " https://github.com/detekt/detekt/releases/download/v${DETEKT_VERSION} /detekt-cli-${DETEKT_VERSION} -all.jar"
15
19
16
- entrypoint_script=" ${HOME} /.local/bin /detekt-cli"
20
+ entrypoint_script=" ${TOOLS} /detekt-cli"
17
21
cat > " $entrypoint_script " << EOM
18
22
java -jar ${jar_destination} /detekt-cli.jar \$ @
19
23
EOM
20
24
chmod +x " $entrypoint_script "
21
25
detekt-cli --version
22
26
23
27
echo " Installing ktlint $KTLINT_VERSION "
24
- curl -sSLO " https://github.com/pinterest/ktlint/releases/download/$KTLINT_VERSION /ktlint" && chmod a+x ktlint && mv ktlint ${HOME} /.local/bin/
25
- ktlint --version
28
+ curl -sSLO " https://github.com/pinterest/ktlint/releases/download/$KTLINT_VERSION /ktlint" && chmod a+x ktlint && mv ktlint ${TOOLS} /
29
+ ktlint --version
30
+
31
+ export PATH=" $PATH :$TOOLS "
You can’t perform that action at this time.
0 commit comments