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.
This commit is contained in:
Afonsop committed 2026-09-18 06:37:40 +01:00
1 parent c6db94e86f
commit 84b093748f
1 file changed
+3 -2
+3 -2
View File
@@ -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