Created
July 11, 2019 09:56
-
-
Save dettmering/17143518510cb06a087f5d449bfd8c35 to your computer and use it in GitHub Desktop.
draw.io: Export all .drawio files in folder to PDF and PNG while preserving history. Very useful as a post-commit hook.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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