~jadedctrl/gem-xwx-moe

~jadedctrl/gem-xwx-moe/gemujo_ludo/mods.niaj/fasado/subtitles/build.sh
 ..
0 #!/usr/bin/env bash
1
2
3 ###############################################################################
4 # #
5 # Subtitles build script #
6 # Written in 2022 by Silver Sandstone <@SilverSandstone@craftodon.social> #
7 # #
8 # To the extent possible under law, the author has dedicated all copyright #
9 # and related and neighbouring rights to this software to the public #
10 # domain worldwide. This software is distributed without any warranty. #
11 # #
12 # You should have received a copy of the CC0 Public Domain Dedication #
13 # along with this software. If not, see #
14 # <https://creativecommons.org/publicdomain/zero/1.0/>. #
15 # #
16 ###############################################################################
17
18
19 set -eu
20 cd "$(dirname "$0")"
21
22
23 function status()
24 {
25 printf '\n\e[1m%s\e[m\n' "$*"
26 }
27
28
29 status 'Generating documentation...'
30 ldoc './' --dir 'doc/' --title 'Subtitles API Reference'
31
32
33 status 'Generating localisation file...'
34 mkdir -p 'locale/'
35 xgettext --from-code='UTF-8' --escape -k'S' --language='lua' -o 'locale/en.pot' --omit-header ./*.lua
36
37
38 status 'Creating distribution...'
39 archive='subtitles.zip'
40 [[ -e "$archive" ]] && rm "$archive"
41 zip -r "$archive" -- \
42 *.lua \
43 mod.conf \
44 settingtypes.txt \
45 build.sh \
46 find-missing.sh \
47 README.md \
48 CHANGELOG.md \
49 LICENSE.md \
50 screenshot.png \
51 textures/ \
52 doc/
53
54
55 status 'Build complete.'
56 grep '^subtitles\.VERSION = ' init.lua