summaryrefslogtreecommitdiffstats
path: root/tools/mission-time.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mission-time.sh')
-rwxr-xr-xtools/mission-time.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/mission-time.sh b/tools/mission-time.sh
new file mode 100755
index 0000000..36c65e7
--- /dev/null
+++ b/tools/mission-time.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Returns mission time on stdout for a mission given on the commandline
+# Make sure the level actually uses MissionTimer, or the script will hang!
+
+colobot -headless -runscene $@ 2>&1 | while read -r line; do
+ if [[ $line =~ Mission[[:space:]]time:[[:space:]]([0-9:.]*) ]]; then
+ echo ${BASH_REMATCH[1]}
+ fi
+done