diff options
-rwxr-xr-x | teal.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/teal.sh b/teal.sh new file mode 100755 index 00000000..86420139 --- /dev/null +++ b/teal.sh | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | # Quick Teal build script while we don't have Cyan integration yet | ||
4 | |||
5 | cd $(dirname $0)/src | ||
6 | |||
7 | i=0 | ||
8 | for tealname in $(find . -name "*.tl" -not -name "*.d.tl") | ||
9 | do | ||
10 | luaname=$(echo $tealname | sed 's/.tl$/.lua/g') | ||
11 | if [ $tealname -nt $luaname ] || [ "$1" = "--all" ] | ||
12 | then | ||
13 | tl gen --check -I ../types $tealname -o $luaname | ||
14 | i=$[i+1] | ||
15 | fi | ||
16 | done | ||
17 | |||
18 | # Final message: | ||
19 | |||
20 | if [ "$1" = "--all" ] | ||
21 | then | ||
22 | what="rebuilt" | ||
23 | else | ||
24 | what="needed rebuilding" | ||
25 | fi | ||
26 | if [ "$i" = 1 ] | ||
27 | then | ||
28 | echo "$i file $what." | ||
29 | else | ||
30 | echo "$i files $what." | ||
31 | fi | ||