summaryrefslogtreecommitdiff
path: root/bin/strict-bashism-check
diff options
context:
space:
mode:
Diffstat (limited to 'bin/strict-bashism-check')
-rwxr-xr-xbin/strict-bashism-check22
1 files changed, 12 insertions, 10 deletions
diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check
index b1bd3bf..fa073b8 100755
--- a/bin/strict-bashism-check
+++ b/bin/strict-bashism-check
@@ -72,14 +72,16 @@ if [ -n "${errors}" ]; then
exit 1
fi
-errors=$(
- cd "${tmp_dir}" || \
- echo 'Cannot cd.'
- shellcheck -x bin/* conf/* 2>&1
-)
-
-if [ -n "${errors}" ]; then
- >&2 echo 'shellcheck complains about the following:'
- >&2 echo "${errors}"
- exit 1
+if which shellcheck >/dev/null 2>&1; then
+ errors=$(
+ cd "${tmp_dir}" || \
+ echo 'Cannot cd.'
+ shellcheck -x bin/* conf/* 2>&1
+ )
+
+ if [ -n "${errors}" ]; then
+ >&2 echo 'shellcheck complains about the following:'
+ >&2 echo "${errors}"
+ exit 1
+ fi
fi