From 5d116c86aea19670147a7f0c0c95a18b5444a3a2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 31 Oct 2017 22:12:16 +1300 Subject: Apply stable check and lint methods to games shell This applies the same stable approach to testing the actual built games that are shebannged with #!/bin/sh as has been applied to the shell scripts in the `check-bin` and `lint-bin` targets. There are no GNU Bash games in these directories, so the latter block of code from the `bin` analogues to check or lint those is not needed. The same applies here; this is not as complete a checking or linting of the games directory as it could be; ideally we would check the sed(1) and awk(1) scripts too. --- lint/games.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lint') diff --git a/lint/games.sh b/lint/games.sh index 6e3e3024..fa2c7a97 100644 --- a/lint/games.sh +++ b/lint/games.sh @@ -1 +1,7 @@ -find games -type f -name '*.sh' -print -exec shellcheck -e SC1090 -s sh -- {} + +# POSIX sh +set -- +for game in games/*.sh ; do + set "$@" "${game%.sh}" +done +shellcheck -e SC1090 -- "$@" || exit +printf 'sh(1) games linted successfully.\n' -- cgit v1.2.3