emqx/scripts/shellcheck.sh
Thales Macedo Garitezi b9494662ae
fix(ci): fix shellcheck file pattern
Since we started to use the portable shebang style for our scripts, we
need to update the pattern used to find scripts for Shellcheck to
check.
2022-01-05 11:34:04 -03:00

19 lines
322 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
target_files=()
while IFS='' read -r line;
do
target_files+=("$line");
done < <(git grep -r -l '^#!/\(bin/\|usr/bin/env bash\)' .)
return_code=0
for i in "${target_files[@]}"; do
echo checking "$i" ...
if ! shellcheck "$i"; then
return_code=1
fi
done
exit $return_code