[CI/Build] Move pre-commit only scripts to tools/pre_commit (#27657)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-10-29 16:04:33 +08:00
committed by GitHub
parent 413ef7a3b4
commit 4fb8771cc0
15 changed files with 16 additions and 17 deletions

15
tools/pre_commit/png-lint.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Ensure that *.excalidraw.png files have the excalidraw metadata
# embedded in them. This ensures they can be loaded back into
# the tool and edited in the future.
find . -iname '*.excalidraw.png' | while read -r file; do
if git check-ignore -q "$file"; then
continue
fi
if ! grep -q "excalidraw+json" "$file"; then
echo "$file was not exported from excalidraw with 'Embed Scene' enabled."
exit 1
fi
done