-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck.sh
More file actions
executable file
·42 lines (37 loc) · 809 Bytes
/
check.sh
File metadata and controls
executable file
·42 lines (37 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
if ! test -d out; then
exit 0
fi
check_commons() {
if grep -F Modules: "$1" | grep -F commons >/dev/null; then
if ! grep -E '^\W*C = Commons\.new' "$1" >/dev/null; then
echo "missing call to Commons.new"
return 1
fi
fi
return 0
}
check_firstrun () {
if grep -F Modules: "$1" | grep -F firstrun >/dev/null; then
if ! grep -E '^\W*FirstRun\(I\)' "$1" >/dev/null; then
echo "missing call to FirstRun"
return 1
fi
fi
return 0
}
TEMP=$(mktemp /tmp/check.XXXXXX)
trap "rm -f $TEMP" EXIT
for f in out/*.lua; do
if lua -l dummy "$f"; then
echo -n "$f: "
if check_commons "$f" && check_firstrun "$f"; then
if luacheck "$f" >$TEMP; then
echo "ok"
else
echo "luacheck"
cat $TEMP
fi
fi
fi
done