Skip to content

Commit b3bee52

Browse files
authored
Merge pull request element-hq#9408 from pacien/custom-profiledir
Add support for custom profile directory
2 parents 0796f32 + 2c9b51f commit b3bee52

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ Desktop app configuration
250250

251251
To run multiple instances of the desktop app for different accounts, you can launch the executable with the `--profile` argument followed by a unique identifier, e.g `riot-web --profile Work` for it to run a separate profile and not interfere with the default one.
252252

253+
Alternatively, a custom location for the profile data can be specified using the `--profile-dir` flag followed by the desired path.
254+
253255
To change the config.json for the desktop app, create a config file which will be used to override values in the config which ships in the package:
254256
+ `%APPDATA%\$NAME\config.json` on Windows
255257
+ `$XDG_CONFIG_HOME\$NAME\config.json` or `~/.config/$NAME/config.json` on Linux

‎electron_app/src/electron-main.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ const Store = require('electron-store');
4242
// migrating to mitigate any risk of it being used maliciously.
4343
let migratingOrigin = false;
4444

45-
if (argv['profile']) {
45+
if (argv['profile-dir']) {
46+
app.setPath('userData', argv['profile-dir']);
47+
} else if (argv['profile']) {
4648
app.setPath('userData', `${app.getPath('userData')}-${argv['profile']}`);
4749
}
4850

0 commit comments

Comments
 (0)