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