aboutsummaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-31 22:05:59 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-31 22:07:30 +1300
commit4cf6ed691373bd3cd0c84369e48f735db8d8fd30 (patch)
treefc4f84b7a88aec3c31caebdfd43ba3f9269a7afd /check
parent805f90b6e49e258f2b3642d02e4a11db2dc68634 (diff)
downloaddotfiles-4cf6ed691373bd3cd0c84369e48f735db8d8fd30.tar.gz
Add conditional Bash `check-bin`, `lint-bin`
Both blocks are analogues of the POSIX checks, but are wrapped in a conditional so that bash(1) doesn't become a hard dependency of the default `make install` target.
Diffstat (limited to 'check')
-rw-r--r--check/bin.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/check/bin.sh b/check/bin.sh
index c3185f19..d504961d 100644
--- a/check/bin.sh
+++ b/check/bin.sh
@@ -1,4 +1,15 @@
+# POSIX sh
for bin in bin/*.sh ; do
sh -n -- "${bin%.sh}" || exit
done
printf 'sh(1) binscripts parsed successfully.\n'
+
+# GNU Bash
+if command -v bash >/dev/null 2>&1 ; then
+ for bin in bin/*.bash ; do
+ bash -n -- "${bin%.bash}" || exit
+ done
+ printf 'bash(1) binscripts parsed successfully.\n'
+else
+ printf 'bash(1) not found, skipping checks.\n'
+fi