pre-commit 241 B

1234567891011121314
  1. #!/bin/sh
  2. to_tidy=$(git diff --cached --name-only | egrep ".p[m|l]$")
  3. # Redirect output to stderr.
  4. exec 1>&2
  5. if [ $to_tidy ]
  6. then
  7. echo "Auto-tidying perl changes..."
  8. perltidy -b $to_tidy
  9. git add $to_tidy
  10. echo "Done."
  11. fi