Fix MPQ detection failing when files are lowercase .mpq

The sanity check `ls *.MPQ *.mpq` fails under `set -o pipefail`
when only one case variant exists, because ls exits non-zero for
the unmatched glob pattern and pipefail propagates that failure.

Use `compgen -G` to check each glob pattern independently instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Radu Ursache 2026-02-21 15:02:07 +02:00
parent 21f7b0f199
commit ca852345a1

View file

@ -54,7 +54,7 @@ if [ -d "${OUTPUT_DIR}/expansions" ]; then
fi fi
# Quick sanity check: look for any .MPQ files # Quick sanity check: look for any .MPQ files
if ! ls "$MPQ_DIR"/*.MPQ "$MPQ_DIR"/*.mpq 2>/dev/null | head -1 > /dev/null 2>&1; then if ! compgen -G "$MPQ_DIR"/*.MPQ > /dev/null 2>&1 && ! compgen -G "$MPQ_DIR"/*.mpq > /dev/null 2>&1; then
echo "Error: No .MPQ files found in: $MPQ_DIR" echo "Error: No .MPQ files found in: $MPQ_DIR"
echo "Make sure this is the WoW Data/ directory (not the WoW root)." echo "Make sure this is the WoW Data/ directory (not the WoW root)."
exit 1 exit 1