perltidy.sh 378 B

12345678910111213
  1. #!/bin/sh
  2. for tool in perltidy git ; do
  3. if ! command -v $tool >/dev/null ; then
  4. printf '%s: ERROR: %s not found\n' "$0" "$tool" >&2
  5. exit 1
  6. fi
  7. done
  8. git status | grep '^[[:cntrl:]]*modified:' | grep -E '\.pl$' | perl -nE 'say +(split)[-1]' | while read file ; do
  9. printf "perltidying '%s'\n" "$file"
  10. perltidy -b -bext='/' -pro=../.perltidyrc "$file"
  11. done