From 98c468dee44e09a27c89019c3d8c584efe0bf1c0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 7 Mar 2018 16:29:58 +0100 Subject: bin/strict-bashism-check: do not fail if shellcheck is not available --- bin/strict-bashism-check | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'bin/strict-bashism-check') 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 -- cgit v1.2.3-70-g09d2