Browse Source

Added suggested changes

master
AGitBoy 6 years ago
parent
commit
527c6a97e5
4 changed files with 6 additions and 6 deletions
  1. +1
    -1
      README.md
  2. +4
    -0
      bin/cli.js
  3. +0
    -1
      src/index.js
  4. +1
    -4
      src/schedule-cleanup.js

+ 1
- 1
README.md View File

@ -10,7 +10,7 @@ clipboard.
## Usage ## Usage
``` ```
$ bitwarden-dmemu --help
$ bitwarden-dmenu --help
Usage: bitwarden-dmenu [options] Usage: bitwarden-dmenu [options]
The DMENU_PATH environment variable can be used to point to an alternative dmenu implementation. Defaults to 'dmenu'. The DMENU_PATH environment variable can be used to point to an alternative dmenu implementation. Defaults to 'dmenu'.


+ 4
- 0
bin/cli.js View File

@ -62,6 +62,10 @@ console.debug = args['verbose']
? (...msgs) => console.log(...msgs, '\n') ? (...msgs) => console.log(...msgs, '\n')
: () => {} : () => {}
console.info = args['stdout']
? () => {}
: console.info
const oldestAllowedVaultSync = syncVaultAfter const oldestAllowedVaultSync = syncVaultAfter
const saveSession = Boolean(sessionTimeout) const saveSession = Boolean(sessionTimeout)
const sessionFile = path.resolve(os.tmpdir(), 'bitwarden-session.txt') const sessionFile = path.resolve(os.tmpdir(), 'bitwarden-session.txt')


+ 0
- 1
src/index.js View File

@ -60,7 +60,6 @@ const chooseAccount = async ({ list, dmenuArgs }) => {
const loginList = list.filter(a => a.type === LOGIN_TYPE) const loginList = list.filter(a => a.type === LOGIN_TYPE)
const accountNames = loginList.map(a => `${a.name}: ${a.login.username}`) const accountNames = loginList.map(a => `${a.name}: ${a.login.username}`)
// -i allows case insensitive matching
const selected = await dmenuRun(dmenuArgs)(accountNames.join('\n')) const selected = await dmenuRun(dmenuArgs)(accountNames.join('\n'))
const index = accountNames.indexOf(selected) const index = accountNames.indexOf(selected)
// accountNames indexes match loginList indexes // accountNames indexes match loginList indexes


+ 1
- 4
src/schedule-cleanup.js View File

@ -21,10 +21,7 @@ module.exports = ({ lockBitwardenAfter, clearClipboardAfter, sessionFile, stdout
console.debug(`${sessionFile} already removed.`) console.debug(`${sessionFile} already removed.`)
} }
bwRun('lock') bwRun('lock')
// don't output to stdout if it is being used for reading information
if(!stdout) {
console.info('bitwarden is locked.')
}
console.info('bitwarden is locked.')
}), }),
timeout(clearClipboardAfter * 1000).then(() => { timeout(clearClipboardAfter * 1000).then(() => {
if(!stdout) { if(!stdout) {


Loading…
Cancel
Save