tidy up Bash script

This commit is contained in:
4am 2021-10-06 00:40:16 -04:00
parent c2a2550702
commit cbc0f4191a

View File

@ -2,16 +2,15 @@
# run from project root directory
games=`cat res/GAMES.CONF | grep "," | grep -v "^#" | cut -d"," -f2 | cut -d"=" -f1 | sort`
cat res/GAMEHELP/STANDARD > "$1"
games=$(grep "," res/GAMES.CONF | grep -v "^#" | cut -d"," -f2 | cut -d"=" -f1 | sort)
cp res/GAMEHELP/STANDARD "$1"
for c in {A..Z}; do
echo -e "group$c"
echo "$games" | grep "^$c" | while read game; do
echo "group$c"
echo "$games" | grep "^$c" | while read -r game; do
echo "!byte ${#game}"
echo "!text \"$game\""
if [ -f "res/GAMEHELP/$game" ]; then
offset=$(wc -c <"$1")
echo "!be24 $offset"
echo "!be24 $(wc -c <"$1")"
cat res/GAMEHELP/"$game" >> "$1"
else
echo "!be24 0"