2017-04-08 16:50:29 +02:00
|
|
|
# Makefile
|
|
|
|
|
|
|
|
all: test
|
|
|
|
|
|
|
|
test:
|
|
|
|
# Checking for syntax errors
|
|
|
|
set -e; for SCRIPT in *.sh; \
|
|
|
|
do \
|
2023-01-19 20:14:48 +01:00
|
|
|
bash -n $$SCRIPT; \
|
2017-04-08 16:50:29 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# Checking for bashisms (currently not failing, but only listing)
|
|
|
|
SCRIPT="$$(which checkbashisms)"; if [ -n "$$SCRIPT" ] && [ -x "$$SCRIPT" ]; \
|
|
|
|
then \
|
|
|
|
$$SCRIPT *.sh || true; \
|
|
|
|
else \
|
|
|
|
echo "WARNING: skipping bashism test - you need to install checkbashism."; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
SCRIPT="$$(which shellcheck)"; if [ -n "$$SCRIPT" ] && [ -x "$$SCRIPT" ]; \
|
|
|
|
then \
|
|
|
|
$$SCRIPT *.sh || true; \
|
|
|
|
else \
|
|
|
|
echo "WARNING: skipping shellcheck test - you need to install shellcheck."; \
|
|
|
|
fi
|