Skip to content

Commit

Permalink
Fix user-data-dir-name switch
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Oct 8, 2018
1 parent 0e18070 commit a57d9e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ const start = (buildConfig = config.defaultBuildConfig, options) => {
if (options.show_component_extensions) {
braveArgs.push('--show-component-extension-options')
}
if (options.user_data_dir_name) {
let user_data_dir
if (process.platform === 'darwin') {
user_data_dir = path.join(process.env.HOME, 'Library', 'Application\\ Support', 'BraveSoftware', options.user_data_dir_name)
} else if (process.platform === 'win32') {
user_data_dir = path.join(process.env.LocalAppData, 'BraveSoftware', options.user_data_dir_name)
} else {
user_data_dir = path.join(process.env.HOME, '.config', 'BraveSoftware', options.user_data_dir_name)
}
braveArgs.push('--user-data-dir=' + user_data_dir);
}

let cmdOptions = {
stdio: 'inherit',
Expand Down
2 changes: 1 addition & 1 deletion scripts/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ program
.command('start')
.option('--v [log_level]', 'set log level to [log_level]', parseInt, '0')
.option('--vmodule [modules]', 'verbose log from specific modules')
.option('--user_data_dir_name [base_name]', 'set user data directory base name to [base_name]', 'brave-development')
.option('--user_data_dir_name [base_name]', 'set user data directory base name to [base_name]', 'Brave-Browser-Development')
.option('--no_sandbox', 'disable the sandbox')
.option('--disable_brave_extension', 'disable loading the Brave extension')
.option('--disable_brave_rewards_extension', 'disable loading the Brave Rewards extension')
Expand Down

0 comments on commit a57d9e1

Please sign in to comment.