support xdg environment vars (#46)

This commit is contained in:
Estelle Poulin 2019-01-14 15:33:14 -05:00 committed by Kyle Spearrin
parent 9c29ab373b
commit 80bb03de91
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,8 @@ export class Main {
p = path.join(process.env.HOME, 'Library/Application Support/Bitwarden CLI'); p = path.join(process.env.HOME, 'Library/Application Support/Bitwarden CLI');
} else if (process.platform === 'win32') { } else if (process.platform === 'win32') {
p = path.join(process.env.APPDATA, 'Bitwarden CLI'); p = path.join(process.env.APPDATA, 'Bitwarden CLI');
} else if (process.env.XDG_CONFIG_HOME) {
p = path.join(process.env.XDG_CONFIG_HOME, 'Bitwarden CLI');
} else { } else {
p = path.join(process.env.HOME, '.config/Bitwarden CLI'); p = path.join(process.env.HOME, '.config/Bitwarden CLI');
} }