From c62c28677ae2b977af570f7c721aa0318afb7095 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 17 May 2018 13:46:40 -0400 Subject: [PATCH] support custom data dir with BITWARDENCLI_APPDATA_DIR --- src/services/lowdbStorage.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/lowdbStorage.service.ts b/src/services/lowdbStorage.service.ts index a11e5c8e28..8c8b9fd165 100644 --- a/src/services/lowdbStorage.service.ts +++ b/src/services/lowdbStorage.service.ts @@ -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);