diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2012-07-20 16:18:36 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2012-07-20 16:18:36 -0700 |
commit | f4d40d38710743fa9f4f12ec035ac9b19e977253 (patch) | |
tree | 319f4ddb02c2d47ee5ff98a6b477edcc8950117b | |
parent | a993c99d576cfef0798d2f69cb807bd8d08ced0a (diff) | |
download | tools-f4d40d38710743fa9f4f12ec035ac9b19e977253.tar.gz tools-f4d40d38710743fa9f4f12ec035ac9b19e977253.tar.bz2 tools-f4d40d38710743fa9f4f12ec035ac9b19e977253.tar.xz tools-f4d40d38710743fa9f4f12ec035ac9b19e977253.zip |
Canonicalize tileset names.
Also remove some executable bits
-rwxr-xr-x | client/edit-map-tileset-names.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/client/edit-map-tileset-names.sh b/client/edit-map-tileset-names.sh new file mode 100755 index 0000000..6c359e2 --- /dev/null +++ b/client/edit-map-tileset-names.sh @@ -0,0 +1,15 @@ +#!/bin/bash +for MAP in maps/*.tmx +do + grep '<tileset\|<image' "$MAP" | + while read TILESET && read IMAGE + do + LINE=$TILESET + TILESET=${TILESET#*name=\"} + TILESET=${TILESET%%\"*} + IMAGE=${IMAGE#*source=\"} + IMAGE=${IMAGE%%.png\"*} + IMAGE=${IMAGE##*/} + sed "/$LINE/s/$TILESET/$IMAGE/" -i "$MAP" + done +done |