Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

Commit

Permalink
allow user to adjust appdata dir with env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Feb 20, 2018
1 parent 1de1aaa commit aa515cb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.ts
Expand Up @@ -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'));
}
Expand Down

0 comments on commit aa515cb

Please sign in to comment.