Emit process exit event with app exit code
This commit is contained in:
parent
d2e63dfc64
commit
63c0095efb
3 changed files with 13 additions and 7 deletions
|
@ -34,6 +34,18 @@ app.setAppPath = (path) ->
|
|||
app.getAppPath = ->
|
||||
appPath
|
||||
|
||||
appExitCode = undefined
|
||||
app.exit = (exitCode) ->
|
||||
appExitCode = exitCode
|
||||
app._exit(exitCode)
|
||||
|
||||
# Map process.exit to app.exit, which quits gracefully.
|
||||
process.exit = app.exit
|
||||
|
||||
# Emit a process 'exit' event on app quit.
|
||||
app.on 'quit', ->
|
||||
process.emit 'exit', appExitCode
|
||||
|
||||
# Routes the events to webContents.
|
||||
for name in ['login', 'certificate-error', 'select-client-certificate']
|
||||
do (name) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue