-
-
Notifications
You must be signed in to change notification settings - Fork 446
Expand file tree
/
Copy pathpre-commit
More file actions
20 lines (19 loc) · 646 Bytes
/
pre-commit
File metadata and controls
20 lines (19 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
echo "Running pre-commit checks..."
OUTPUT="/tmp/analysis-result"
./gradlew detekt ktlintCheck > ${OUTPUT}
EXIT_CODE=$?
if [ ${EXIT_CODE} -ne 0 ]; then
cat ${OUTPUT}
rm ${OUTPUT}
echo "*********************************************"
echo " Checks Failed! "
echo " Resolve found issues before committing "
echo "*********************************************"
exit ${EXIT_CODE}
else
rm ${OUTPUT}
echo "*********************************************"
echo " Checks Passed Successfully! "
echo "*********************************************"
fi