draw.io: Export all .drawio files in folder to PDF and PNG while preserving history. Very useful as a post-commit hook.
#!/bin/bash | |
rm -f *.pdf | |
rm -f *.png | |
COMMIT=$(git rev-parse HEAD) | |
for f in *.drawio | |
do | |
/Applications/draw.io.app/Contents/MacOS/draw.io --export --all-pages --output $f.pdf $f | |
/Applications/draw.io.app/Contents/MacOS/draw.io --export --all-pages --output $f.png $f | |
cp $f.pdf history/$f.${COMMIT::8}.pdf | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment