diff --git a/main.js b/main.js index 0d362716e..b50629004 100644 --- a/main.js +++ b/main.js @@ -10,6 +10,19 @@ let orig_win; let all_wins = []; let load_project_data; +(() => { + // Allow advanced users to specify a custom userData directory. + // Useful for portable installations, and for setting up development environments. + const index = process.argv.findIndex(arg => arg === '--userData'); + if (index !== -1) { + if (!process.argv.at(index + 1)) { + console.error('No path specified after --userData') + process.exit(1) + } + app.setPath('userData', process.argv[index + 1]); + } +})() + const LaunchSettings = { path: path.join(app.getPath('userData'), 'launch_settings.json'), settings: {},