Skip to content

Commit

Permalink
optimize: use parallel if available to lint in parallel
Browse files Browse the repository at this point in the history
Signed-off-by: pasta <pasta@dashboost.org>
  • Loading branch information
PastaPastaPasta committed Dec 22, 2021
1 parent 283ee31 commit 9605218
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/lint/lint-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ LINTALL=$(basename "${BASH_SOURCE[0]}")

EXIT_CODE=0

SCRIPTS=()

for f in "${SCRIPTDIR}"/lint-*.sh; do
if [ "$(basename "$f")" != "$LINTALL" ]; then
SCRIPTS+=("$f")
fi
done


if ! parallel --help > /dev/null; then
for f in "${SCRIPTDIR}"/lint-*.sh; do
if [ "$(basename "$f")" != "$LINTALL" ]; then
if ! "$f"; then
Expand All @@ -26,5 +36,9 @@ for f in "${SCRIPTDIR}"/lint-*.sh; do
fi
fi
done
elif ! parallel --jobs 100% bash ::: ${SCRIPTS[*]}; then
echo "^---- failure generated"
EXIT_CODE=1
fi

exit ${EXIT_CODE}

0 comments on commit 9605218

Please sign in to comment.