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