aboutsummaryrefslogtreecommitdiff
path: root/lint
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-02 17:08:20 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-02 17:08:20 +1200
commit82d75833d1e864a4e79248a0b275329e25094048 (patch)
tree55583357ab480a1fda1c2fcbbdd9cce075693e60 /lint
parentRemove leading blank line (diff)
downloaddotfiles-82d75833d1e864a4e79248a0b275329e25094048.tar.gz
dotfiles-82d75833d1e864a4e79248a0b275329e25094048.zip
Spruce up lint-bin and lint-games scripts
Diffstat (limited to 'lint')
-rwxr-xr-xlint/bin14
-rwxr-xr-xlint/games12
2 files changed, 17 insertions, 9 deletions
diff --git a/lint/bin b/lint/bin
index 1f7d9c66..c5729fdb 100755
--- a/lint/bin
+++ b/lint/bin
@@ -1,7 +1,11 @@
#!/bin/sh
-for bin in bin/* ; do
- if sed 1q "$bin" | grep -q -- 'sh$' ; then
- printf '%s\n' "$bin"
- shellcheck -- "$bin"
- fi
+for bin in games/* ; do
+ [ -e "$bin" ] || continue
+ hb=$(sed 1q "$bin") || exit
+ case $hb in
+ *sh)
+ printf '%s\n' "$bin"
+ shellcheck -- "$bin"
+ ;;
+ esac
done
diff --git a/lint/games b/lint/games
index 1802b3fd..6deac3b1 100755
--- a/lint/games
+++ b/lint/games
@@ -1,7 +1,11 @@
#!/bin/sh
for game in games/* ; do
- if sed 1q "$game" | grep -q -- 'sh$' ; then
- printf '%s\n' "$game"
- shellcheck -- "$game"
- fi
+ [ -e "$game" ] || continue
+ hb=$(sed 1q "$game") || exit
+ case $hb in
+ *sh)
+ printf '%s\n' "$game"
+ shellcheck -- "$game"
+ ;;
+ esac
done