pmbootstrap/.ci/shellcheck.sh

16 lines
289 B
Bash
Raw Permalink Normal View History

#!/bin/sh -e
# Description: lint all shell scripts
2022-11-20 15:38:59 +00:00
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add shellcheck
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
find . -name '*.sh' |
while read -r file; do
echo "shellcheck: $file"
shellcheck "$file"
done