Setup crash reporter on 'will-finish-launching' event.

This commit is contained in:
Cheng Zhao
2013-06-03 22:24:57 +08:00
parent 2b3d3d9cf5
commit be309aba69
2 changed files with 14 additions and 11 deletions

View File

@@ -2,7 +2,6 @@ AtomWindow = require './atom-window'
BrowserWindow = require 'browser-window'
Menu = require 'menu'
autoUpdater = require 'auto-updater'
crashReporter = require 'crash-reporter'
app = require 'app'
ipc = require 'ipc'
dialog = require 'dialog'
@@ -45,7 +44,6 @@ class AtomApplication
@pathsToOpen ?= []
@windows = []
@setupCrashReporter()
@listenForArgumentsFromNewProcess()
@setupNodePath()
@setupJavaScriptArguments()
@@ -89,11 +87,6 @@ class AtomApplication
process.env['NODE_PATH'] = resourcePaths.join path.delimiter
setupCrashReporter: ->
crashReporter.setCompanyName 'GitHub'
crashReporter.setSubmissionUrl 'https://speakeasy.githubapp.com/submit_crash_log'
crashReporter.setAutoSubmit true
listenForArgumentsFromNewProcess: ->
fs.unlinkSync socketPath if fs.existsSync(socketPath)
server = net.createServer (connection) =>

View File

@@ -1,5 +1,6 @@
AtomApplication = require './atom-application'
autoUpdater = require 'auto-updater'
crashReporter = require 'crash-reporter'
delegate = require 'atom-delegate'
app = require 'app'
fs = require 'fs'
@@ -23,10 +24,8 @@ delegate.browserMainParts.preMainMessageLoopRun = ->
app.on 'open-file', addPathToOpen
app.on 'will-finish-launching', ->
autoUpdater.setFeedUrl 'https://speakeasy.githubapp.com/apps/27/appcast.xml'
autoUpdater.setAutomaticallyChecksForUpdates true
autoUpdater.setAutomaticallyDownloadsUpdates true
autoUpdater.checkForUpdatesInBackground()
setupCrashReporter()
setupAutoUpdater()
app.on 'finish-launching', ->
app.removeListener 'open-file', addPathToOpen
@@ -39,6 +38,17 @@ delegate.browserMainParts.preMainMessageLoopRun = ->
getHomeDir = ->
process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
setupCrashReporter = ->
crashReporter.setCompanyName 'GitHub'
crashReporter.setSubmissionUrl 'https://speakeasy.githubapp.com/submit_crash_log'
crashReporter.setAutoSubmit true
setupAutoUpdater = ->
autoUpdater.setFeedUrl 'https://speakeasy.githubapp.com/apps/27/appcast.xml'
autoUpdater.setAutomaticallyChecksForUpdates true
autoUpdater.setAutomaticallyDownloadsUpdates true
autoUpdater.checkForUpdatesInBackground()
parseCommandLine = ->
version = fs.readFileSync(path.join(__dirname, '..', '..', 'version'), 'utf8')