-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexport.sh
executable file
·48 lines (40 loc) · 920 Bytes
/
export.sh
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
43
44
45
46
47
48
#!/usr/bin/env bash
set -e
GODOT_VER="4.0.4"
function _init() {
local godot_version
if ! command -v godot > /dev/null; then
echo "error: command 'godot' not found" 1>&2
exit 1
elif ! godot_version=$(godot --version); then
echo "error: command 'godot --version' failed" 1>&2
exit 1
elif [[ "${godot_version}" != ${GODOT_VER:?}* ]]; then
echo "error: wrong Godot version '${godot_version}'. Required version: ${GODOT_VER:?}" 1>&2
exit 1
fi
f=$(mktemp)
trap 'rm $f' EXIT
cd dmcetraceGUI || exit 1
}
function _export() {
local err
err=0
echo "$1"
for _ in 1 2; do
godot --export-release "$1" --headless |& tee "$f"
if ! grep -q -i "error" "$f"; then
# no errors
return 0
fi
err=$((err + 1))
if [ $err -eq 2 ]; then
echo "error: export '$1' failed two times in a row - check log" 1>&2
return 1
fi
done
}
_init
_export "Linux"
_export "Windows"
du --time -hs dmce-gui*