aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-01-22 15:05:07 -0300
committerEuAndreh <eu@euandre.org>2021-01-22 15:05:07 -0300
commit4dc56a8b6f6fc0c0f16a92d51f99583909303f95 (patch)
tree35f0851a967774efb697f1d280a71d142d548f54
parentremembering: ShellCheck (diff)
downloadremembering-4dc56a8b6f6fc0c0f16a92d51f99583909303f95.tar.gz
remembering-4dc56a8b6f6fc0c0f16a92d51f99583909303f95.tar.xz
Add build-aux/assert-shellcheck.sh and run in "check" target
-rw-r--r--Makefile5
-rwxr-xr-xbuild-aux/assert-shellcheck.sh6
2 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index e9537b2..61f4072 100644
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,11 @@ uninstall:
check:
sh tests/all.sh
+ if [ -d .git ]; then \
+ echo 'Assuming Git repository, running development checks.'; \
+ sh build-aux/assert-shellcheck.sh; \
+ fi
+
dist:
if git show $(VERSION) 1>/dev/null 2>/dev/null; then \
echo 'Version $(VERSION) already exists.'; \
diff --git a/build-aux/assert-shellcheck.sh b/build-aux/assert-shellcheck.sh
new file mode 100755
index 0000000..334a875
--- /dev/null
+++ b/build-aux/assert-shellcheck.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -eux
+
+git ls-files -z | \
+ xargs -0 awk 'FNR==1 && /^#!\/bin\/sh$/ { print FILENAME }' | \
+ xargs shellcheck