aboutsummaryrefslogtreecommitdiff
path: root/ktlint/src/main/resources/ktlint-git-pre-commit-hook.sh
blob: dcc2485fce3426d652a94ec31c3c96297de0fb17 (plain)
1
2
3
4
#!/bin/sh
# https://github.com/shyiko/ktlint pre-commit hook
git diff --name-only --cached --relative | grep '\.kts\?$' | xargs ktlint --relative .
if [ $? -ne 0 ]; then exit 1; fi