From 9c2081276fd7644ef8a5b380b1bc9f1b051cd6da Mon Sep 17 00:00:00 2001 From: Yoshiofthewire Date: Sat, 14 Nov 2026 15:57:11 -0500 Subject: [PATCH] ci: stop a file named - hiding a binary from the guard file reads an operand named - as standard input even after --, so a tracked binary with that name was never inspected. Prefix every tracked path with ./ before handing it to file. Co-Authored-By: Claude Fable 5.2 --- scripts/check-no-binaries.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-no-binaries.sh b/scripts/check-no-binaries.sh index 9aa5e0e..7378997 100755 --- a/scripts/check-no-binaries.sh +++ b/scripts/check-no-binaries.sh @@ -6,7 +6,7 @@ cd "$(git rev-parse --show-toplevel)" types='application/(x-(executable|pie-executable|sharedlib|object|archive|mach-binary|dosexec)|vnd\.microsoft\.portable-executable|java-archive|x-java-applet|wasm)$' # Add a pathspec exclusion such as ':!gradle/wrapper/gradle-wrapper.jar' only for a # binary the repo must carry, with the reason beside it. -found=$(git ls-files -z -- . | xargs -0 -r file --mime-type -- | grep -E "$types" || true) +found=$(git ls-files -z -- . | sed -z 's|^|./|' | xargs -0 -r file --mime-type -- | grep -E "$types" || true) if [ -n "$found" ]; then echo "Compiled binaries are tracked; build them from source instead:" >&2 echo "$found" >&2