Files
dockerfiles/shellcheck.sh
Uwe Hermann 60908559b6
Some checks failed
checks / check and test (push) Failing after 2s
checks / check and test (pull_request) Failing after 2s
* MOD: test actions
Signed-off-by: Uwe Hermann <uh@uleenucks.de>
2024-01-20 12:15:14 +01:00

25 lines
471 B
Bash
Executable File

#!/bin/bash
set -e
set -o pipefail
ERRORS=()
# find all executables and run `shellcheck`
for f in $(find . -type f -not -iwholename '*.git*' -not -name "Dockerfile" | sort -u); do
if file "$f" | grep --quiet shell; then
{
shellcheck "$f" && echo "[OK]: sucessfully linted $f"
} || {
# add to errors
ERRORS+=("$f")
}
fi
done
if [ ${#ERRORS[@]} -eq 0 ]; then
echo "No errors, hooray"
else
echo "These files failed shellcheck: ${ERRORS[*]}"
exit 1
fi