]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler-autobuild
fix another wrong chdir
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler-autobuild
index 6e8b9802d0755f9adea6ad6b26c78fd45aae972c..ebd10c303cf3fd2c4e8e7ef5cb7ee2b0046aed5d 100755 (executable)
@@ -16,10 +16,16 @@ allmaps()
 {
        commithash=$1
        shift
-       for F in `git ls-files "$commithash" -- maps/\*.map.options`; do
-               M=${F#maps/}
-               M=${M%.map.options}
-               blobhash=`git rev-parse --revs-only "$commithash:maps/$M.map.options" || true`-`git rev-parse --revs-only "$commithash:maps/$M.map" || true`
+       for F in `git show "${commithash}:maps/"`; do
+               case "$F" in
+                       *.map.options)
+                               ;;
+                       *)
+                               continue
+                               ;;
+               esac
+               M=${F%.map.options}
+               blobhash=`git rev-parse --revs-only "${commithash}:maps/$M.map.options" || true`-`git rev-parse --revs-only "${commithash}:maps/$M.map" || true`
                case "$blobhash" in
                        -*)
                                ;;
@@ -290,6 +296,7 @@ runmakeindex()
        branches | while read -r HASH TYPE REFNAME; do
                allmaps "$HASH" indexthemap "$REFNAME"
        done
+       cd ../..
 }
 
 case "$1" in
@@ -305,10 +312,10 @@ case "$1" in
                git checkout -f master
                ;;
        screenshot)
+               runmakeindex > "branches.idx.new"
+               rsync -vaSHP "branches.idx.new" "$url_ssh""branches.idx.new"
+               rm -f "branches.idx.new"
                cd data/xonotic-maps.pk3dir
-               runmakeindex > branches.idx.new
-               rsync -vaSHP "$branches.idx.new" "$url_ssh""branches.idx.new"
-               rm -f branches.idx.new
                branches | while read -r HASH TYPE REFNAME; do
                        if [ -f "$screenshot_cachedir/$HASH" ]; then
                                continue
@@ -320,8 +327,9 @@ case "$1" in
                        fi
 
                        cd data/xonotic-maps.pk3dir
-
                        allmaps "$HASH" screenshotthemap "$REFNAME" "$url_http"
+                       cd ../..
+
                        touch "$screenshot_cachedir/$HASH"
                done
                git checkout -f master
@@ -330,7 +338,9 @@ case "$1" in
                runmakeindex
                ;;
        download)
+               cd data/xonotic-maps.pk3dir
                rundownload
+               cd ../..
                echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
                ls -l "$bspdir.old" || true
                ;;