forked from brave/brave-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.js
More file actions
55 lines (50 loc) · 1.64 KB
/
start.js
File metadata and controls
55 lines (50 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const path = require('path')
const config = require('../lib/config')
const util = require('../lib/util')
const start = (buildConfig = config.defaultBuildConfig, options) => {
config.buildConfig = buildConfig
config.update(options)
const braveArgs = [
'--enable-logging',
'--v=' + options.v,
]
if (options.no_sandbox) {
braveArgs.push('--no-sandbox')
}
if (options.disable_brave_extension) {
braveArgs.push('--disable-brave-extension')
}
if (options.disable_pdfjs_extension) {
braveArgs.push('--disable-pdfjs-extension')
}
if (options.ui_mode) {
braveArgs.push(`--ui-mode=${options.ui_mode}`)
}
if (!options.enable_brave_update) {
// This only has meaning with MacOS and official build.
braveArgs.push('--disable-brave-update')
}
if (options.single_process) {
braveArgs.push('--single-process')
}
if (options.vmodule) {
braveArgs.push('--vmodule=${options.vmodule}')
}
let cmdOptions = {
stdio: 'inherit',
shell: true
}
if (process.platform === 'darwin') {
let product_name = 'Brave-Browser'
if (config.channel) {
// Capitalize channel name and append it to make product name like Brave-Browser-Beta
product_name = product_name + '-' + config.channel.charAt(0).toUpperCase() + config.channel.slice(1)
}
util.run(path.join(config.outputDir, product_name + '.app', 'Contents', 'MacOS', product_name), braveArgs, cmdOptions)
} else if (process.platform === 'win32') {
util.run(path.join(config.outputDir, 'brave.exe'), braveArgs, cmdOptions)
} else {
util.run(path.join(config.outputDir, 'brave'), braveArgs, cmdOptions)
}
}
module.exports = start