From 5ee470640c5b5299cedc8f3a03faf6a805d04399 Mon Sep 17 00:00:00 2001 From: vv221 Date: Sat, 9 Feb 2019 22:10:39 +0100 Subject: [PATCH] Add a new test allowing to test the syntax of a single game script --- tests/shellcheck-single-game-script.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tests/shellcheck-single-game-script.sh diff --git a/tests/shellcheck-single-game-script.sh b/tests/shellcheck-single-game-script.sh new file mode 100755 index 00000000..af693431 --- /dev/null +++ b/tests/shellcheck-single-game-script.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +set -o errexit + +script="$1" + +if [ ! -e "$script" ]; then + printf 'USAGE: %s SCRIPT\n' "$0" + exit 0 +fi + +for shell in 'sh' 'bash' 'dash' 'ksh'; do + printf 'Testing %s validity using ShellCheck in %s mode…\n' "$script" "$shell" + shellcheck --exclude=SC2034 --external-sources --shell="$shell" "$script" +done + +exit 0 -- GitLab