xonotic/misc/tools/xonotic-map-compiler-autobuild
2010-05-06 17:00:41 +02:00

31 lines
792 B
Bash
Executable File

#!/bin/sh
bspdir="$PWD/bspfiles"
mkdir -p "$bspdir"
cd data/xonotic-maps.pk3dir
git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
git reset --hard
git clean -xfd
git checkout "$HASH"
for F in maps/*.map.options; do
if ! [ -f "$F" ]; then
continue
fi
if ! [ -f "${F%.options}" ]; then
continue
fi
M=${F#maps/}
M=${M%.map.options}
blobhash="$M"-`git ls-files -s -- "$F" | cut -d ' ' -f 2`-`git ls-files -s -- "${F%.options}" | cut -d ' ' -f 2`
if [ -f "$bspdir/$blobhash.pk3" ]; then
continue
fi
(
cd maps
../../../misc/tools/xonotic-map-compiler "$M" -noshaderlist `head -n 1 "../$F"` 2>&1 | tee "$M.log"
)
zip -9r "$bspdir/$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M/" "gfx/${M}_mini.tga"
done
done
git checkout master