maps/build.sh
author carine
Mon, 01 Dec 2014 15:15:25 +0100
changeset 743 0e58fabc0175
parent 502 9a2e364edc6d
permissions -rwxr-xr-x
test
743
carine
parents: 502
diff changeset
     1
#
75
d09d886e2b93 note on inkscape dep
Dominique Hazaël-Massieux <dom@w3.org>
parents: 74
diff changeset
     2
# depends on inkscape to generate PNG versions
280
d578c224652e bug fix in map generation
Dominique Hazael-Massieux <dom@w3.org>
parents: 262
diff changeset
     3
DESTDIR="$2"
262
133321e41d2f parametrizing
Dominique Hazaël-Massieux <dom@w3.org>
parents: 95
diff changeset
     4
133321e41d2f parametrizing
Dominique Hazaël-Massieux <dom@w3.org>
parents: 95
diff changeset
     5
if [ ! -d "$DESTDIR" ] ; then mkdir "$DESTDIR" ; fi
94
a1e76f2ae28c bug fix in regexp
Dominique Hazaël-Massieux <dom@w3.org>
parents: 79
diff changeset
     6
280
d578c224652e bug fix in map generation
Dominique Hazael-Massieux <dom@w3.org>
parents: 262
diff changeset
     7
if [ ! -d "$DESTDIR" ] ; then echo "$DESTDIR doesn't exist and couldn't be created" ; exit 1; fi
d578c224652e bug fix in map generation
Dominique Hazael-Massieux <dom@w3.org>
parents: 262
diff changeset
     8
94
a1e76f2ae28c bug fix in regexp
Dominique Hazaël-Massieux <dom@w3.org>
parents: 79
diff changeset
     9
ROOMS_IDS=`cat rooms.json|cut -d ":" -f 2|cut -d "," -f 1|cut -d '"' -f 2|grep -v "\["|grep -v "\]"`
76
0dd72fb392c6 minor bug fix
Dominique Hazaël-Massieux <dom@w3.org>
parents: 75
diff changeset
    10
ROOMS_SVG=`for i in $ROOMS_IDS; do echo "$i.svg" ; done`
69
312c8df3900b script to build png version of map per-room
Dominique Hazaël-Massieux <dom@w3.org>
parents:
diff changeset
    11
76
0dd72fb392c6 minor bug fix
Dominique Hazaël-Massieux <dom@w3.org>
parents: 75
diff changeset
    12
for i in $ROOMS_SVG
262
133321e41d2f parametrizing
Dominique Hazaël-Massieux <dom@w3.org>
parents: 95
diff changeset
    13
do cat "$1" |sed -e 's/"text\/css">/"text\/css">#'`basename $i .svg`' { fill: yellow;}/' > $i; inkscape $i -e "$DESTDIR"/`basename $i .svg`.png 2>/dev/null ; rm $i
74
bd147e3c013f copy base file
Dominique Hazaël-Massieux <dom@w3.org>
parents: 71
diff changeset
    14
done
bd147e3c013f copy base file
Dominique Hazaël-Massieux <dom@w3.org>
parents: 71
diff changeset
    15
262
133321e41d2f parametrizing
Dominique Hazaël-Massieux <dom@w3.org>
parents: 95
diff changeset
    16
cp "$1" "$DESTDIR"/main.svg
502
Dominique Hazael-Massieux <dom@w3.org>
parents: 280
diff changeset
    17
inkscape "$DESTDIR"/main.svg -e "$DESTDIR"/main.png