Browse Source

refactor: improve serverlist validation script

The commit refactors the serverlist validation script to include a new check. It now compares all game servers listed in `serverlist.csv` to `$shortname-icon.png` files in `lgsm/data/gameicons`. If a game server is listed in `serverlist.csv`, it should have a corresponding `$shortname-icon.png` file. The commit adds a loop that checks for the existence of these files and outputs an error message if any are missing.
pull/4345/head
Daniel Gibbs 2 years ago
parent
commit
c4f9b1d2cf
No known key found for this signature in database GPG Key ID: 2076B128385E8C55
  1. 15
      .github/workflows/serverlist-validate.sh

15
.github/workflows/serverlist-validate.sh

@ -19,4 +19,19 @@ for csv in $csvlist; do
fi fi
done done
# Compare all game servers listed in serverlist.csv to $shortname-icon.png files in lgsm/data/gameicons
# if the game server is listed in serverlist.csv then it will have a $shortname-icon.png file
# loop though shortname in serverlist.csv
echo "Checking that all the game servers listed in serverlist.csv have a shortname-icon.png file"
for shortname in $(tail -n +2 serverlist.csv | cut -d ',' -f1); do
# check if $shortname-icon.png exists
if [ ! -f "gameicons/${shortname}-icon.png" ]; then
echo "ERROR: gameicons/${shortname}-icon.png does not exist"
exitcode=1
else
echo "OK: gameicons/${shortname}-icon.png exists"
fi
done
exit ${exitcode} exit ${exitcode}

Loading…
Cancel
Save