     @emitter.dispose()
 
   getCwd: ->
-    cwd = @runOptions.workingDirectory
+    cwd = @scriptOptions.workingDirectory
 
     workingDirectoryProvided = cwd? and cwd isnt ''
     paths = atom.project.getPaths()


  options: ->
    cwd: @getCwd()
    env: @runOptions.mergedEnv(process.env)

  args: (codeContext, extraArgs) ->
    args = (@runOptions.cmdArgs.concat extraArgs).concat @runOptions.scriptArgs
    if not @runOptions.cmd? or @runOptions.cmd is ''
      args = codeContext.shebangCommandArgs().concat args
    args


  # Public: Creates a Runner instance
  #
  # * `scriptOptions` a {ScriptOptions} object instance
  # * `emitter` Atom's {Emitter} instance. You probably don't need to overwrite it
  constructor: (@scriptOptions, @emitter = new Emitter) ->

  run: (command, extraArgs, codeContext, inputString = null) ->
    @startTime = new Date()
