path: root/lint
diff options
authorTom Ryder <tom@sanctum.geek.nz>2017-10-31 22:12:16 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-31 22:12:16 +1300
commit5d116c86aea19670147a7f0c0c95a18b5444a3a2 (patch)
treefcaa177930a8cb9a916e06b9f22c6ffef899992d /lint
parentCorrect copypaste errors in `check-bin`, `lint-bin` (diff)
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.
Diffstat (limited to 'lint')
1 files changed, 7 insertions, 1 deletions
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}"
+shellcheck -e SC1090 -- "$@" || exit
+printf 'sh(1) games linted successfully.\n'