Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Use exec instead of execSync and don't exit
Browse files Browse the repository at this point in the history
execSync on Windows causes a hang and app.exit() will have data loss because it will bypass normal shutdown
  • Loading branch information
bbondy committed Dec 20, 2018
1 parent 8decf8c commit e1aa13d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ app.commandLine.appendSwitch('enable-features', 'BlockSmallPluginContent,PreferH
// Fix https://github.com/brave/browser-laptop/issues/15337
app.commandLine.appendSwitch('disable-databases')


// Domains to accept bad certs for. TODO: Save the accepted cert fingerprints.
let acceptCertDomains = {}
let errorCerts = {}
Expand Down
7 changes: 3 additions & 4 deletions js/stores/appStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,16 @@ const launchBraveCore = (state) => {
}

const childProcess = require('child_process')
const execSync = childProcess.execSync
const exec = childProcess.exec

try {
if (platformUtil.isDarwin()) {
execSync(`open -a "${installedPath}"`)
exec(`open -a "${installedPath}"`)
console.log('opened brave-core instance (at "' + installedPath + '")')
} else if (platformUtil.isWindows()) {
execSync(`"${installedPath}\\brave.exe"`)
exec(`"${installedPath}\\brave.exe"`)
console.log('opened brave-core instance (at "' + installedPath + '\\brave.exe")')
}
app.exit()
} catch (e) {
console.log('ERROR: tried to launch brave-core (at "' + installedPath +
'"), but an exception was thrown:\n' + e.toString())
Expand Down

0 comments on commit e1aa13d

Please sign in to comment.