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

Commit

Permalink
Correct relaunch logic
Browse files Browse the repository at this point in the history
fix #11821
fix #11824

Auditors: @bsclifton

Test Plan:
a. CHANNEL=beta npm start shouldn't relaunch

b. CHANNEL=beta npm build-package
b-1. ./BraveBeta-win32-x64/BraveBeta.exe should relaunch and use `brave-beta` as user dir
b-2 CHANNEL=beta npm build-installer
b-3 Install Brave by dist/x64/BraveBeta-Setup-x64.exe
b-4 After installation, the first time launch should relaunch and use `brave-beta` as user dir
  • Loading branch information
darkdh committed Nov 10, 2017
1 parent 81df03b commit 6e4b725
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 6 additions & 3 deletions app/windowsInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ if (process.platform === 'win32') {
}

const userDataDirSwitch = '--user-data-dir-name=brave-' + channel
if (channel && channel !== 'dev' && !process.argv.includes(userDataDirSwitch)) {
if (channel !== 'dev' && !process.argv.includes(userDataDirSwitch) &&
!process.argv.includes('--relaunch') &&
!process.argv.includes('--user-data-dir-name=brave-development')) {
delete process.env.CHROME_USER_DATA_DIR
if (cmd === '--squirrel-firstrun') {
app.relaunch({args: [userDataDirSwitch, '--relaunch']})
} else {
app.relaunch({args: process.argv.slice(1) + [userDataDirSwitch, '--relaunch']})
app.relaunch({args: process.argv.slice(1).concat([userDataDirSwitch, '--relaunch'])})
}
app.quit()
app.exit()
}
}

Expand Down
4 changes: 1 addition & 3 deletions tools/buildInstaller.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ if (isDarwin) {
setupExe: `${appName}-Setup-${arch}.exe`
})
resultPromise.then(() => {
cmds = [
]
execute(cmds, {}, console.log.bind(null, 'done'))
console.log('done')
}, (e) => console.log(`No dice: ${e.message}`))
})
} else if (isLinux) {
Expand Down

0 comments on commit 6e4b725

Please sign in to comment.