diff --git a/bin/cli.js b/bin/cli.js index 2c2753f..6dd0ce0 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -4,7 +4,7 @@ const os = require('os') const path = require('path') const { exec } = require('child_process') const minimist = require('minimist') -const menu = require('../src/index') +const menu = require('../src') const scheduleCleanup = require('../src/schedule-cleanup') const cachePasswordDefault = 15 diff --git a/package.json b/package.json index 2aa1f9e..2282a74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitwarden-dmenu", - "version": "1.1.3", + "version": "1.1.4", "description": "dmenu for bitwarden password manager.", "keywords": [ "bitwarden", diff --git a/src/index.js b/src/index.js index fcdf506..c314d40 100644 --- a/src/index.js +++ b/src/index.js @@ -21,7 +21,7 @@ const getSessionVar = async ({ saveSession, sessionFile }) => { // prompt for password in dmenu const password = await dmenuRun('\n', '-p Password: -nf black -nb black') if (!password) throw new Error('no password given!') - const session = bwRun(`unlock '${password}' --raw`) + const session = bwRun(`unlock $'${password.replace(`'`, `\\'`)}' --raw`) writeFileSync(sessionFile, session) console.debug('saved new session file.') return session @@ -29,7 +29,7 @@ const getSessionVar = async ({ saveSession, sessionFile }) => { } else { const password = await dmenuRun('\n', '-p Password: -nf black -nb black') if (!password) throw new Error('no password given!') - const session = bwRun(`unlock '${password}' --raw`) + const session = bwRun(`unlock $'${password.replace(`'`, `\\'`)}' --raw`) return session } }