Created
August 6, 2019 22:03
-
-
Save ShaunPlummer/17f620880c0249758bc0f5f40b8cac19 to your computer and use it in GitHub Desktop.
Example of a pre commit hook which runs a series of gradle tasks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#declare -a arr=("./gradlew ktlint" "./gradlew detekt") | |
declare -a arr=() | |
for i in "${arr[@]}" | |
do | |
$i | |
RESULT=$? | |
echo output: $RESULT | |
if [ $RESULT != "0" ] | |
then | |
echo Pre commit hook failure | |
exit $RESULT | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment