mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-27 12:26:38 +01:00
allow user to adjust appdata dir with env variable
This commit is contained in:
parent
1de1aaa971
commit
aa515cb369
10
src/main.ts
10
src/main.ts
@ -24,8 +24,14 @@ export class Main {
|
||||
|
||||
constructor() {
|
||||
// Set paths for portable builds
|
||||
if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
|
||||
const appDataPath = path.join(process.env.PORTABLE_EXECUTABLE_DIR, 'bitwarden-appdata');
|
||||
let appDataPath = null;
|
||||
if (process.env.BITWARDEN_APPDATA_DIR != null) {
|
||||
appDataPath = process.env.BITWARDEN_APPDATA_DIR;
|
||||
} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
|
||||
appDataPath = path.join(process.env.PORTABLE_EXECUTABLE_DIR, 'bitwarden-appdata');
|
||||
}
|
||||
|
||||
if (appDataPath != null) {
|
||||
app.setPath('userData', appDataPath);
|
||||
app.setPath('logs', path.join(appDataPath, 'logs'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user