From 395c60b1ce1c8bc84746ecfefba21d3234b288fa Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 23 Aug 2017 21:35:06 +0200 Subject: silence a lot shellcheck warnings --- bin/strict-bashism-check | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bin/strict-bashism-check') diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check index a6694f4..1bcfdfd 100755 --- a/bin/strict-bashism-check +++ b/bin/strict-bashism-check @@ -21,8 +21,8 @@ if [ "$allownonascii" != "true" ] && # Note that the use of brackets around a tr range is ok here, (it's # even required, for portability to Solaris 10's /usr/bin/tr), since # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 + test "$(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c)" != 0 then cat <<\EOF Error: Attempt to add a non-ASCII file name. @@ -50,7 +50,8 @@ git archive "${tree}" | \ tar -C "${tmp_dir}" -x errors=$( - cd "${tmp_dir}" + cd "${tmp_dir}" || \ + echo 'Cannot cd.' find "bin" "conf" -type f -not -executable -not -name '.gitignore' ) @@ -71,7 +72,8 @@ if [ -n "${errors}" ]; then fi errors=$( - cd "${tmp_dir}" + cd "${tmp_dir}" || \ + echo 'Cannot cd.' checkbashisms bin/* conf/* 2>&1 ) -- cgit v1.2.3-54-g00ecf