     @messageSchema = MESSAGE_SCHEMA
     @optionsSchema = OPTIONS_SCHEMA
     @commands = {start: @startCommand, stop: @stopCommand}
-    @dir = path.join __dirname, 'tmp'
+    @tmpDir = path.join __dirname, 'tmp'
 
   onMessage: (message) =>
     payload = message.payload;
     command = @commands[payload.command]
     return unless command?
     command (error, stdout) =>
-      if error?
+      if  error?
         @emit 'error', error
         @emit 'message', error: error
         return

      @runCommand @options.start, callback

  setup: (callback=->) =>
    mkdirp @dir, (error) =>
      return callback error if error?
      @runCommand @options.setup, callback

  runCommand: (command, callback=->) =>
    child_process.exec command, cwd: @dir, (error, stdout, stderr) =>
      if error?
        error.stdout = stdout
        error.stderr = stderr

OPTIONS_SCHEMA =
  type: 'object'
  properties:
    gitRepo:
      type: 'string'
      required: true
      default: 'https://github.com/org/project'
    setup:
      type: 'string'
      required: true
