shellcheck.sh 324 B

1234567891011121314
  1. #!/bin/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