Skip to content

Commit

Permalink
Fix updater detaching from engine
Browse files Browse the repository at this point in the history
  • Loading branch information
sungshon authored Jun 10, 2019
1 parent f0ee9fa commit 7f764b9
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions upd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ function startEngine(binDir) {
if (opts.linuxTray)
env['LINUX_TRAY'] = '1'

if (!opts.isVerbose)
env['PMS_TOKEN'] = Date.now() + ''
else
if (opts.isVerbose)
env['PMS_VERBOSE'] = '1'

const procOpts = { cwd: binDir, env }

if (!opts.isVerbose)
if (!opts.isVerbose) {
procOpts.detached = true
procOpts.stdio = 'ignore'
}

if (isWin)
procOpts.windowsHide = true
Expand All @@ -209,14 +209,9 @@ function startEngine(binDir) {
process.exit()
})
} else {
msg('Starting engine')
msg('Starting engine, closing updater')
addonProc.unref()
addonProc.stdout.on('data', data => {
if (data && data.toString().trim() == env['PMS_TOKEN']) {
msg('Engine started, closing updater')
process.exit()
}
})
process.exit()
}

}
Expand Down

0 comments on commit 7f764b9

Please sign in to comment.