     event.preventDefault()
     args.pathsToOpen.push(pathToOpen)
 
-  args.urlsToOpen = []
   addUrlToOpen = (event, urlToOpen) ->
     event.preventDefault()
     args.urlsToOpen.push(urlToOpen)
 
   app.on 'open-file', addPathToOpen
   app.on 'open-url', addUrlToOpen
-
-  app.on 'will-finish-launching', ->
-    setupCrashReporter()
+  app.on 'will-finish-launching', setupCrashReporter
 
   app.on 'ready', ->
     app.removeListener 'open-file', addPathToOpen

  logFile = args['log-file']
  socketPath = args['socket-path']
  profileStartup = args['profile-startup']

  if args['resource-path']
    devMode = true

  process.env.ATOM_DEV_RESOURCE_PATH ? path.join(app.getHomeDir(), 'github', 'atom')
)

setupUncaughtExceptionHandler = ->
  process.on 'uncaughtException', (error={}) ->
    console.log(error.message) if error.message?
    console.log(error.stack) if error.stack?

handleStartupEventWithSquirrel = ->
  return false unless process.platform is 'win32'
  SquirrelUpdate = require './squirrel-update'
  squirrelCommand = process.argv[1]
  SquirrelUpdate.handleStartupEvent(app, squirrelCommand)

setupCrashReporter = ->
  crashReporter.start(productName: 'Atom', companyName: 'GitHub')

setupAtomHome = ->
  return if process.env.ATOM_HOME
  atomHome = path.join(app.getHomeDir(), '.atom')
  try
    atomHome = fs.realpathSync(atomHome)
