Permalink
Browse files

Added run.sh tool, thanks felix

  • Loading branch information...
1 parent b2e4c9d commit 302ed01ac69ed7e7a3db9c11e86eba05ffdd42e3 @vjeux committed Jan 9, 2012
Showing with 33 additions and 0 deletions.
  1. +6 −0 Makefile
  2. +27 −0 run.sh
View
6 Makefile
@@ -0,0 +1,6 @@
+
+all:
+ @echo "Nothing to do"
+
+clean:
+ rm -f *.log
View
27 run.sh
@@ -0,0 +1,27 @@
+# /bin/sh
+
+# ./run.sh <# of the process to get stdout from> <processes ...>
+# ./run.sh 0 bots/bot_coop.py bots/bot_coop.py bots/bot_coop.py
+
+n=$1
+shift
+
+i=0
+while [ -n "$1" ]; do
+ i=$((i+1))
+ if [ "$n" -eq "$i" ]; then
+ sleep 1 && python "$1" &
+ else
+ sleep 1 && python "$1" > ${i}.log 2>&1 &
+ fi
+ shift
+done
+
+if [ "$n" -eq 0 ]; then
+ coffee server/server.coffee
+else
+ sleep 1 && echo "Press Enter to Start a Game!" &
+ coffee server/server.coffee > 0.log 2>&1
+fi
+
+wait

0 comments on commit 302ed01

Please sign in to comment.