Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CLI argument to specify the userData folder. #2309

Merged
merged 5 commits into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand Down