2023-10-14 17:52:18 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-11-11 23:17:57 +00:00
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
ORIGDIR=$PWD
|
2019-11-12 00:40:20 +00:00
|
|
|
tmp=$(mktemp -d)
|
|
|
|
cleanup() {
|
|
|
|
rm -rf "$tmp"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
2019-11-11 23:17:57 +00:00
|
|
|
|
2023-10-05 23:21:47 +00:00
|
|
|
export SDL_VIDEODRIVER=dummy
|
2019-11-11 23:17:57 +00:00
|
|
|
|
2023-10-05 23:21:47 +00:00
|
|
|
export DOOMWADDIR=$PWD/extract
|
2019-11-11 23:17:57 +00:00
|
|
|
|
|
|
|
$SOURCE_PORT -iwad miniwad.wad \
|
2019-11-12 00:40:20 +00:00
|
|
|
-mb 24 \
|
2019-11-11 23:17:57 +00:00
|
|
|
-nodraw -noblit -nosound -noautoload -nogui -nograbmouse \
|
2023-10-05 23:21:47 +00:00
|
|
|
-statdump $tmp/statdump.txt \
|
|
|
|
"$@" >$tmp/log.txt 2>&1 || true
|
2019-11-11 23:17:57 +00:00
|
|
|
|
2023-10-05 23:21:47 +00:00
|
|
|
if [ ! -e $tmp/statdump.txt ]; then
|
|
|
|
(echo "No statdump output produced."; cat $tmp/log.txt) >/dev/stderr
|
2019-11-12 00:40:20 +00:00
|
|
|
exit 1
|
2019-11-11 23:17:57 +00:00
|
|
|
else
|
2023-10-05 23:21:47 +00:00
|
|
|
cat $tmp/statdump.txt
|
2019-11-11 23:17:57 +00:00
|
|
|
fi
|
|
|
|
|