Fixed homepath in simulate script

This commit is contained in:
Michael Schmatz 2014-05-19 10:40:20 -07:00
parent 5dd8bec393
commit 078f6b5dcd

View file

@ -1,12 +1,12 @@
spawn = require("child_process").spawn
[sessionOne, sessionTwo] = [process.argv[2],process.argv[3]]
homeDirectory = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE
unless sessionOne and sessionTwo and sessionOne.length is 24 and sessionTwo.length is 24
console.log "Not enough games to continue!"
process.exit(1)
run = (cb) ->
command = spawn("coffee",["headless_client.coffee","one-game",sessionOne,sessionTwo],{cwd:"/Users/schmatz/codecombat/"})
command = spawn("coffee",["headless_client.coffee","one-game",sessionOne,sessionTwo],{cwd: homeDirectory + "/codecombat/"})
result = ""
command.stdout.on 'data', (data) ->
result += data.toString()