From 84b093748f80d0f832500e4562844c0d087c7c10 Mon Sep 17 00:00:00 2001 From: Afonsop Date: Fri, 18 Sep 2026 06:37:40 +0100 Subject: [PATCH] build: fix the no-fonts guard for multiple matches `echo web/fonts/*.ttf` expands to every match at once, so [ -e ] on the multi-word string failed and skipped the copy step even with all 13 fonts present. find | head -n 1 survives both multiple matches and spaces in paths. --- scripts/build-web.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build-web.sh b/scripts/build-web.sh index 862f7bf01..d22a68665 100644 --- a/scripts/build-web.sh +++ b/scripts/build-web.sh @@ -29,8 +29,9 @@ trunk build --release --dist dist/app --public-url /app/ "$@" # Mirror the font sources over the bundle and verify the copy-dir output. mkdir -p dist/app/fonts # Hard-fail with a clear message when there are no fonts to verify. -first_font=$(echo web/fonts/*.ttf) -if [ ! -e "$first_font" ]; then +# (find | head -1 survives multiple matches and spaces in paths.) +first_font=$(find web/fonts -name '*.ttf' -print 2>/dev/null | head -n 1) +if [ -z "$first_font" ]; then echo "build-web.sh: no .ttf fonts found under web/fonts — nothing to ship or verify" >&2 exit 1 fi