Remove temp dir at ^C, kill, terminal closed, broken pipe, segfault, etc as well... 62/head
authorbones_was_here <bones_was_here@yahoo.com.au>
Sun, 12 Apr 2020 22:02:24 +0000 (08:02 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Sun, 12 Apr 2020 22:02:24 +0000 (08:02 +1000)
misc/tools/all/xonotic.subr

index 9eb9bc0..cb3b675 100644 (file)
@@ -395,6 +395,7 @@ case "$cmd" in
                ;;
        serverbench)
                # TODO(rpolzer): Why does :anticheat: output differ? Total game time differs? Why?
+               trap "rm -rf .serverbench_temp" 0 1 2 3 11 13 15
                mkdir -p .serverbench_temp
                verbose "$SELF" run dedicated "$@" -noconfig -userdir .serverbench_temp +exec serverbench.cfg |\
                        tee /dev/stderr |\
@@ -402,7 +403,6 @@ case "$cmd" in
                        grep -v '^:gamestart:' |\
                        grep -v '^:anticheat:' |\
                        md5sum
-               rm -rf .serverbench_temp
                ;;
        *)
                handled=false