1
0
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:
Kyle Spearrin 2018-02-20 16:04:35 -05:00
parent 1de1aaa971
commit aa515cb369

View File

@ -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'));
}