   createAtomWindow: ->
     new AtomWindow
       bootstrapScript: 'window-bootstrap',
-      resourcePath: resourcePath
+      resourcePath: @resourcePath
 
 class AtomWindow
   bootstrapScript: null
   resourcePath: null
 
   constructor: ({@bootstrapScript, @resourcePath}) ->
-    @resourcePath ?= path.dirname(__dirname)
     @window = @open()
 
     @window.on 'close', (event) =>

bootstrapApplication = ->
  parseCommandLine()
  setupNodePath()
  atomApplication = new AtomApplication
  atomApplication.createAtomWindow()

delegate.browserMainParts.preMainMessageLoopRun = bootstrapApplication

dialog = require 'dialog'

class AtomApplication
  resourcePath: null
  windowState: null
  menu: null
  windows: null

  constructor: (@resourcePath) ->
    @resourcePath ?= path.dirname(__dirname)
    @windowState = {}
    @windows = []

