diff --git a/lib/start.js b/lib/start.js index f3fc5df5a791..27fd00f307ab 100644 --- a/lib/start.js +++ b/lib/start.js @@ -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', diff --git a/scripts/commands.js b/scripts/commands.js index 78f2ab5031b3..18c54c57018e 100644 --- a/scripts/commands.js +++ b/scripts/commands.js @@ -63,7 +63,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')