summaryrefslogtreecommitdiff
path: root/tools/edit-all-to-export-tilesets.sh
blob: 7be3411f9476a56382d5beda73b126c507bc89e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
for MAP in $(ls maps | grep '\.tmx$')
do
    TILESETS=$(
        grep '<tileset' "maps/$MAP" |
            while read TILESET
            do
                TILESET=${TILESET#*name=\"}
                TILESET=${TILESET%%\"*}
                echo tilesets/${TILESET}.tsx
            done
    )
    rm -f ${TILESETS}
    (cd tilesets; tiled ../maps/$MAP;)
    git add -N tilesets/
    git add --patch
done