shellcheck.sh 322 B

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