Code

implemented proper error checking
[inkscape.git] / share / extensions / dia2svg.sh
1 #! /bin/sh
3 rc=0
5 # dia version 0.93 (the only version I've tested) allows `--export=-', but then
6 # ruins it by writing other cruft to stdout.  So we'll have to use a temp file.
7 # dia 0.95 removes --export-to-format but still allows -t.
8 TMPDIR="${TMPDIR-/tmp}"
9 TEMPFILENAME=`mktemp 2>/dev/null || echo "$TMPDIR/tmpdia$$.svg"`
10 dia -n --export="${TEMPFILENAME}" -t svg "$1" > /dev/null 2>&1 || rc=1
12 cat < "${TEMPFILENAME}" || rc=1
13 rm -f "${TEMPFILENAME}"
14 exit $rc