]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler-autobuild
fix handling of the logs
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler-autobuild
index 2ee3af1f03d0aa70028843758a7ad318cd4fbc0b..4d2798f057eddd5af451ca6c4c5fbd35de043263 100755 (executable)
@@ -222,8 +222,8 @@ screenshotthemap()
                continue
        fi
 
-       rm -rf ~/.xonotic
-       mkdir -p ~/.xonotic
+       rm -rf ~/.xonotic/data
+       mkdir -p ~/.xonotic/data
        (
                cd ../..
                if [ -n "$DISPLAY" ]; then
@@ -238,26 +238,24 @@ screenshotthemap()
                                        ;;
                        esac
                fi
-       ) >~/.xonotic/autoscreenshot.log 2>&1
-       if ! mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
-               if [ -n "$IRCSPAM" ]; then
-                       #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$commithash" 1 > "maps/$M.ircss"
-                       ss2spam "$M" "$url?d" "$REFNAME" "$commithash" 1 > "maps/$M.ircss"
-               fi
-               return 1
-       fi
-       mv ~/.xonotic/autoscreenshot.log "$M-$blobhash"/ || true
-       if [ -n "$IRCSPAM" ]; then
-               #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$commithash" 0 > "maps/$M.ircss"
-               ss2spam "$M" "$url?d" "$REFNAME" "$commithash" 0 > "maps/$M.ircss"
+       ) 2>&1 | tee ~/.xonotic/data/autoscreenshot.log
+       good=false
+       if mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
+               ss2spam "$M" "$url?d" "$REFNAME" "$commithash" 0 > ~/.xonotic/data/"$M.ircss"
+       else
+               mkdir "$M-$blobhash"
+               ss2spam "$M" "$url?d" "$REFNAME" "$commithash" 1 > ~/.xonotic/data/"$M.ircss"
        fi
+       mv ~/.xonotic/data/"$M.ircss" "$M-$blobhash"/
+       mv ~/.xonotic/data/autoscreenshot.log "$M-$blobhash"/
        chmod 1777 "$M-$blobhash"
        ln -snf "../$M-$blobhash" "$M" # from ALL branches, so beware!
        rsync -vaSHP "$M-$blobhash" "$url_ssh"
        rsync -vaSHP "$M" "$url_ssh""latest/"
        if [ -n "$IRCSPAM" ]; then
-               $IRCSPAM < "maps/$M.ircss"
+               $IRCSPAM < "$M-$blobhash/$M.ircss"
        fi
+       return 1
 }
 
 getthemap()