forked from LibreDWG/libredwg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svg.in
48 lines (46 loc) · 1.22 KB
/
svg.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# create -v3 logs and SVG from dwg's with dwg2SVG
srcdir="@srcdir@"
top_builddir="@top_builddir@"
make -s -C src
make -s -C programs dwg2SVG
@DSYMUTIL@ programs/dwg2SVG
v=-v3
# dummy to please shellcheck
test -z "$v" && echo $top_builddir
out=
ob="$b"
for d in "$@"; do
case $d in
-v*) v="$d"
;;
*)
if [ ! -f "$d" ]; then
if [ -f "$srcdir/test/test-data/$d" ]
then
d="$srcdir/test/test-data/$d";
else
if [ -f "$srcdir/test/test-data/$d.dwg" ]
then
d="$srcdir/test/test-data/$d.dwg"
fi
fi
fi
xd=$(dirname "$d")
dir=_$(basename "$xd")
if [ "$dir" = "_test-data" ]; then dir=""; fi
if [ "$dir" = "_td" ]; then dir=""; fi
if [ "$dir" = "_." ]; then dir=""; fi
b=$(basename "$d" .dwg)
log="$b$dir.svg.log"
out="$b$dir.svg"
echo @TIMEOUT_10@ @LTEXEC@ programs/dwg2SVG "$v" "$d" \>"$out" 2\>"$log"
@TIMEOUT_10@ @LTEXEC@ programs/dwg2SVG "$v" "$d" >"$out" 2>"$log"
tail -n2 "$log"
echo "@RUN_JING@ $out"
@RUN_JING@ "$out"
;;
esac
done
v=
b="$ob"