shellcheck.sh 333 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. target_files=()
  4. while IFS='' read -r line; do target_files+=("$line"); done < <(grep -r -l --exclude-dir=.git --exclude-dir=_build "#!/bin/" .)
  5. return_code=0
  6. for i in "${target_files[@]}"; do
  7. echo checking "$i" ...
  8. if ! shellcheck "$i"; then
  9. return_code=1
  10. fi
  11. done
  12. exit $return_code