# Abort the script on error.
set -e
-# Give helpful message to players that want to start without compiling first.
-if [ ! -e ./roguelike-server ]
+# Don't let any log leftovers from before interfere.
+if [ -e ./log ]
then
- echo 'No ./roguelike-server file found to execute. Try "make" first?'
- false
+ rm log
fi
+
+# Give helpful message to players that want to start without compiling first.
if [ ! -e ./roguelike-client ]
then
- echo 'No ./roguelike-client file found to execute. Try "make" first?'
+ echo 'No ./roguelike-client file found to execute. Try "./redo" first?'
false
fi
# This script's wrapper script will read it out on exit.
./roguelike-server "$@" > log 2>&1 &
-echo TEST >> log
-
# Give server some time to start up and exit on error.
sleep 0.01