Commit 26f16073 authored by Antoine Le Gonidec's avatar Antoine Le Gonidec

Add a test to use shellcheck on game scripts — Enable parallel processing of scripts

parent 2e79638b
#!/usr/bin/env sh
set -o errexit
for file in play.it-2/games/*; do
for shell in 'sh' 'bash' 'dash' 'ksh'; do
printf 'Testing %s validity using ShellCheck in %s mode…\n' "$file" "$shell"
shellcheck --exclude=SC2034 --external-sources --shell="$shell" "$file"
done
count="$(find 'play.it-2/games' -type f | wc --lines)"
max_procs="$(nproc)"
max_args="$((count / max_procs + 1))"
for shell in 'sh' 'bash' 'dash' 'ksh'; do
printf 'Testing game scripts validity using ShellCheck in %s mode…\n' "$shell"
find 'play.it-2/games' -type f | xargs --max-args="$max_args" --max-procs="$max_procs" shellcheck --exclude=SC2034 --external-sources --shell="$shell"
done
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment