]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler-autobuild
also checkout -f here
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler-autobuild
index 672489ff3de62e899d1317c1ef9afbe3ca83c2b3..c2d7fe6b8b1e625f4279cd968d9e7e232f912519 100755 (executable)
@@ -125,12 +125,12 @@ buildthemap()
        if [ -n "$IRCSPAM" ]; then
                pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
        fi
-       t0=`date +$s`
+       t0=`date +%s`
        (
                cd maps
                ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $override > "$M.log"
        )
-       t1=`date +$s`
+       t1=`date +%s`
        dt=$(($t1 - $t0))
        status=$?
        if [ -n "$IRCSPAM" ]; then
@@ -173,14 +173,18 @@ case "$1" in
                git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
                        git reset --hard
                        git clean -xfd
-                       git checkout "$HASH"
+                       git checkout -f "$HASH"
                        allmaps buildthemap "$REFNAME" "$HASH" "$url" "$bspoutdir"
                done
-               git checkout master
+               git checkout -f master
                ;;
        download)
                mkdir -p "$bspdir" "$bspdir.old"
-               mv "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3 "$bspdir.old"/ || true
+               for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
+                       if [ -e "$b" ]; then
+                               mv "$b" "$bspdir.old"/
+                       fi
+               done
                cd data/xonotic-maps.pk3dir
                allmaps getthemap "$url" "$bspdir.old" "$bspdir"
                echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"