Created
September 10, 2019 10:53
-
-
Save alexrashed/9495066b0980e6490db17fa28065b125 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
convert () { | |
drawiofile=$1 | |
file=${drawiofile::-7} | |
pdffile="${file}.pdf" | |
echo "Updating $file" | |
curl --data-urlencode "format=pdf" --data-urlencode "xml@$drawiofile" --output $pdffile https:\//exp.draw.io/ImageExport4/export | |
pdfcrop $pdffile $pdffile | |
} | |
if [ $# -eq 0 ] | |
then | |
echo "No specific file given, converting all drawio drawings in the current folder." | |
for drawiofile in *.drawio | |
do | |
convert $drawiofile | |
done | |
else | |
echo "Only converting drawio file $1" | |
convert $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment