support custom data dir with BITWARDENCLI_APPDATA_DIR

This commit is contained in:
Kyle Spearrin 2018-05-17 13:46:40 -04:00
parent 7abc87992a
commit c62c28677a
1 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,9 @@ export class LowdbStorageService implements StorageService {
constructor(appDirName: string) {
let p = null;
if (process.platform === 'darwin') {
if (process.env.BITWARDENCLI_APPDATA_DIR) {
p = path.resolve(process.env.BITWARDENCLI_APPDATA_DIR);
} else if (process.platform === 'darwin') {
p = path.join(process.env.HOME, 'Library/Application Support', appDirName);
} else if (process.platform === 'win32') {
p = path.join(process.env.APPDATA, appDirName);