png-lint.sh 430 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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