     resourcePaths.push path.join(homeDir, '.atom', 'packages')
 
     resourcePaths = resourcePaths.map (relativeOrAbsolutePath) =>
-      path.resolve @commandLineArgs['resource-path'], relativeOrAbsolutePath
+      path.resolve @resourcePath, relativeOrAbsolutePath
 
     process.env['NODE_PATH'] = resourcePaths.join path.delimiter
 

      dialog.openFolder currentWindow, {}, (result, paths...) =>
        new AtomWindow
          bootstrapScript: 'window-bootstrap',
          resourcePath: @commandLineArgs['resource-path']

class AtomWindow
  @windows = []


class BrowserMain
  windowState: null
  resourcePath: null

  constructor: ->
    @windowState = {}

    @parseCommandLine()
    @setupNodePaths()
    @handleEvents()

  parseCommandLine: ->
    modifiedArgv = ['node'].concat(process.argv) # optimist assumes the first arg will be node
    args = optimist(modifiedArgv).argv
    @resourcePath = args['resource-path']

  setupNodePaths: ->
    resourcePaths = [
