Skip to content

Instantly share code, notes, and snippets.

@mbohun
Created September 3, 2012 06:25
Show Gist options
  • Save mbohun/3607275 to your computer and use it in GitHub Desktop.
Save mbohun/3607275 to your computer and use it in GitHub Desktop.
dia_export-diagrams.sh
#!/bin/bash
#
# uses the dia http://live.gnome.org/Dia command line interface to
# re-generate .png diagrams from .dia files in a directory, this way
# - you can get images of diagrams regenerated 'automatically' everytime
# you modify a diagram (.dia file)
# - you do not have to keep your images in sync with diagrams manually
# - you do not need to store .png/.jpg/.svg in repository
# - can be run as a hook, inotify, cronjob
#
DIA=/usr/bin/dia
for file in `ls | grep -i ".*\.dia$"`
do
base=`expr "$file" : '\(.*\)\.dia$'`
$DIA --export=$base.png --filter=pixbuf-png $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment