From dcee7ca8e40fc6a910ffe58ca96aad3bf2b338d8 Mon Sep 17 00:00:00 2001 From: Andrew Quenehen Date: Sat, 1 Aug 2026 04:28:31 -0300 Subject: [PATCH] fix(build): avoid SIGPIPE from grep -q on love zip listing Under pipefail, unzip|grep -q exits 141 when grep closes early on a match and aborts mac pack. List once to a file, then grep the listing. Co-authored-by: Cursor --- scripts/build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index eb719f8b..6b0489fa 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -68,8 +68,11 @@ rm -f "$LOVE_FILE" tools/rom_manifest.json tools/rom_manifest_blue.json \ tools/rom_manifest_yellow.json \ -x '*.DS_Store' 'data/generated/*' 'assets/generated/*') -if unzip -Z1 "$LOVE_FILE" \ - | grep -Eq '^(data|assets)/generated/[^/]+|^(data|assets)/generated/.+/'; then +# Materialize the listing once. Piping unzip→grep -q under `set -o pipefail` +# SIGPIPEs unzip when grep exits early on a match and aborts the build. +LOVE_LIST="$WORK/love-listing.txt" +unzip -Z1 "$LOVE_FILE" > "$LOVE_LIST" +if grep -Eq '^(data|assets)/generated/[^/]+|^(data|assets)/generated/.+/' "$LOVE_LIST"; then fail "game.love unexpectedly contains generated ROM data" fi # The editor is only reachable if its entry point and both module directories @@ -81,7 +84,7 @@ for required in tools/save-editor/App.lua tools/save-editor/Kit.lua \ tools/save-editor/panels/Party.lua \ tools/rom_manifest.json tools/rom_manifest_blue.json \ tools/rom_manifest_yellow.json; do - unzip -Z1 "$LOVE_FILE" | grep -qx "$required" \ + grep -qxF "$required" "$LOVE_LIST" \ || fail "game.love is missing $required" done say "game.love: $(du -h "$LOVE_FILE" | cut -f1)"