4cade/bin/buildhelp.sh

20 lines
523 B
Bash
Raw Normal View History

2021-10-06 02:20:15 +00:00
#!/bin/bash
# run from project root directory
2021-10-06 04:40:16 +00:00
games=$(grep "," res/GAMES.CONF | grep -v "^#" | cut -d"," -f2 | cut -d"=" -f1 | sort)
cp res/GAMEHELP/STANDARD "$1"
2021-10-06 02:20:15 +00:00
for c in {A..Z}; do
2021-10-06 04:40:16 +00:00
echo "group$c"
echo "$games" | grep "^$c" | while read -r game; do
2021-10-06 02:20:15 +00:00
echo "!byte ${#game}"
echo "!text \"$game\""
if [ -f "res/GAMEHELP/$game" ]; then
2021-10-06 04:40:16 +00:00
echo "!be24 $(wc -c <"$1")"
2021-10-06 02:20:15 +00:00
cat res/GAMEHELP/"$game" >> "$1"
else
echo "!be24 0"
fi
done
done > "$2"