From 078f6b5dcd3a9a43cf4d1eb8d3d2ae6ab4dc2c20 Mon Sep 17 00:00:00 2001 From: Michael Schmatz Date: Mon, 19 May 2014 10:40:20 -0700 Subject: [PATCH] Fixed homepath in simulate script --- scripts/simulate.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/simulate.coffee b/scripts/simulate.coffee index 346b0c196..01eccb5f9 100644 --- a/scripts/simulate.coffee +++ b/scripts/simulate.coffee @@ -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()