git-hook-pre-commit.sh 246 B

1234567891011
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. files="$(git diff --cached --name-only | grep -E '.*\.erl' || true)"
  4. if [[ "${files}" == '' ]]; then
  5. exit 0
  6. fi
  7. files="$(echo -e "$files" | xargs)"
  8. # shellcheck disable=SC2086
  9. ./scripts/erlfmt -c $files