amethyst/git-hooks/pre-push

24 wiersze
623 B
Plaintext
Czysty Zwykły widok Historia

2023-03-07 18:08:11 +00:00
#!/bin/bash
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
echo "*********************************************************"
2023-03-08 19:17:04 +00:00
echo "Running git pre-push hook. Running test... "
2023-03-07 18:08:11 +00:00
echo "*********************************************************"
2023-03-08 19:17:04 +00:00
./gradlew test
2023-03-07 18:08:11 +00:00
status=$?
if [ "$status" = 0 ] ; then
2023-03-08 19:17:04 +00:00
echo "All test passed."
2023-03-07 18:08:11 +00:00
exit 0
else
echo "*********************************************************"
2023-03-08 19:17:04 +00:00
echo 1>&2 "Failing test"
printf "Run ${GREEN}./gradlew test${NO_COLOR} to make sure you have all tests green before pushing...\n"
2023-03-07 18:08:11 +00:00
echo "*********************************************************"
exit 1
fi