]> git.rm.cloudns.org Git - xonotic/xonotic-maps.pk3dir.git/commitdiff
speed up the converter by calling sed only once
authorRudolf Polzer <divverent@alientrap.org>
Tue, 5 Oct 2010 19:06:51 +0000 (21:06 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 5 Oct 2010 19:06:51 +0000 (21:06 +0200)
scripts/shader-convert-nex2xon.sh

index e7118cdbc5a2ebc4eab91a1ba691220bced0094d..a9757f88db235a63c12a62a020af1d26a399c962 100755 (executable)
@@ -1,11 +1,10 @@
-f=$1
+sed=""
 map()
 {
        rawfile=$1
        from=$2
        to=$3
-       sed -i "s,\<${from#textures/}\>,${to#textures/}," "$f"
-       sed -i "s,\<${rawfile#textures/}\>,${to#textures/}," "$f"
+       sed="$sed""s,\<${from#textures/}\>,${to#textures/},;"
 }
 map textures/exx/base/base_crete01 textures/eX/eX_cretebase_01 textures/exx/base-crete01
 map textures/exx/base/base_crete02 textures/eX/eX_cretebase_02 textures/exx/base-crete02
@@ -310,3 +309,5 @@ map textures/trak5x/wall/wall_wall5d textures/trak5/wall5d textures/trak5x/wall-
 map textures/trak5x/wall/wall_wall5e textures/trak5/wall5e textures/trak5x/wall-wall5e
 map textures/trak5x/wall/wall_wall6a textures/trak5/wall6a textures/trak5x/wall-wall6a
 map textures/trak5x/wall/wall_wall7a textures/trak5/wall7a textures/trak5x/wall-wall7a
+
+sed -i "$sed" "$1"