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 11#! /bin/bash
2+
3+ set -e
4+
25if [[ " $DETEKT_VERSION " == " " ]]; then
36 echo " Privide detekt version in DETEKT_VERSION env variable"
47 exit 1
@@ -7,19 +10,22 @@ if [[ "$KTLINT_VERSION" == "" ]]; then
710 echo " Provide ktlint version in KTLINT_VERSION env variable"
811 exit 1
912fi
10- mkdir -p ${HOME} /.local/bin
13+ TOOLS=" $( pwd) /tools"
14+ mkdir -p ${TOOLS}
1115echo " Installing detekt $DETEKT_VERSION "
12- jar_destination=" ${HOME} /.local /lib/detekt"
16+ jar_destination=" ${TOOLS} /lib/detekt"
1317mkdir -p ${jar_destination}
1418curl -sSL -o ${jar_destination} /detekt-cli.jar " https://github.com/detekt/detekt/releases/download/v${DETEKT_VERSION} /detekt-cli-${DETEKT_VERSION} -all.jar"
1519
16- entrypoint_script=" ${HOME} /.local/bin /detekt-cli"
20+ entrypoint_script=" ${TOOLS} /detekt-cli"
1721cat > " $entrypoint_script " << EOM
1822java -jar ${jar_destination} /detekt-cli.jar \$ @
1923EOM
2024chmod +x " $entrypoint_script "
2125detekt-cli --version
2226
2327echo " 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