aboutsummaryrefslogtreecommitdiff
path: root/test/games
blob: c1e3cf4a611e2409f6d820febeb7b3d4743394e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
for game in games/* ; do
    [ -e "$game" ] || continue
    hb=$(sed 1q "$game") || exit
    case $hb in
        *bash)
            bash -n "$game" || exit
            ;;
        *sh)
            sh -n "$game" || exit
            ;;
        *'sed -f')
            sed -f "$game" /dev/null >/dev/null || exit
            ;;
        *'awk -f')
            # Not sure how to test these yet
            ;;
        *)
            printf 2>&1 'Unknown hashbang for %s\n' "$game"
            exit 1
            ;;
    esac
done
printf 'All shell scripts in games parsed successfully.\n'