mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-24 11:55:50 +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() {
|
constructor() {
|
||||||
// Set paths for portable builds
|
// Set paths for portable builds
|
||||||
if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
|
let appDataPath = null;
|
||||||
const appDataPath = path.join(process.env.PORTABLE_EXECUTABLE_DIR, 'bitwarden-appdata');
|
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('userData', appDataPath);
|
||||||
app.setPath('logs', path.join(appDataPath, 'logs'));
|
app.setPath('logs', path.join(appDataPath, 'logs'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user