Merge branch 'master' into ns-alternative-test-env

This commit is contained in:
Nathan Sobo
2015-10-13 17:59:46 -06:00
6 changed files with 56 additions and 22 deletions

View File

@@ -67,6 +67,8 @@ class AtomApplication
constructor: (options) ->
{@resourcePath, @devResourcePath, @version, @devMode, @safeMode, @socketPath, timeout} = options
@socketPath = null if options.test
global.atomApplication = this
@pidsToOpenWindows = {}
@@ -132,6 +134,7 @@ class AtomApplication
# the other launches will just pass their information to this server and then
# close immediately.
listenForArgumentsFromNewProcess: ->
return unless @socketPath?
@deleteSocketFile()
server = net.createServer (connection) =>
connection.on 'data', (data) =>
@@ -141,7 +144,7 @@ class AtomApplication
server.on 'error', (error) -> console.error 'Application server failed', error
deleteSocketFile: ->
return if process.platform is 'win32'
return if process.platform is 'win32' or not @socketPath?
if fs.existsSync(@socketPath)
try