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

View File

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