1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh ./gradlew spotlessCheck -q EXIT_CODE=$? if [ $EXIT_CODE -ne 0 ]; then echo "❌ spotlessCheck failed, running spotlessApply for you..." ./gradlew spotlessApply -q echo "Formatting done, please try your commit again! If the problem persists, apply fixes manually." exit $EXIT_CODE fi exit 0