From 527c6a97e598978586d47651ed99c4356525667f Mon Sep 17 00:00:00 2001 From: AGitBoy Date: Sat, 26 Jan 2019 23:50:11 -0500 Subject: [PATCH] Added suggested changes --- README.md | 2 +- bin/cli.js | 4 ++++ src/index.js | 1 - src/schedule-cleanup.js | 5 +---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a3d042c..f69f35b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ clipboard. ## Usage ``` -$ bitwarden-dmemu --help +$ bitwarden-dmenu --help Usage: bitwarden-dmenu [options] The DMENU_PATH environment variable can be used to point to an alternative dmenu implementation. Defaults to 'dmenu'. diff --git a/bin/cli.js b/bin/cli.js index 5cc6ee1..90e3978 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -62,6 +62,10 @@ console.debug = args['verbose'] ? (...msgs) => console.log(...msgs, '\n') : () => {} +console.info = args['stdout'] + ? () => {} + : console.info + const oldestAllowedVaultSync = syncVaultAfter const saveSession = Boolean(sessionTimeout) const sessionFile = path.resolve(os.tmpdir(), 'bitwarden-session.txt') diff --git a/src/index.js b/src/index.js index 7e9e0ef..7873bbc 100644 --- a/src/index.js +++ b/src/index.js @@ -60,7 +60,6 @@ const chooseAccount = async ({ list, dmenuArgs }) => { const loginList = list.filter(a => a.type === LOGIN_TYPE) const accountNames = loginList.map(a => `${a.name}: ${a.login.username}`) - // -i allows case insensitive matching const selected = await dmenuRun(dmenuArgs)(accountNames.join('\n')) const index = accountNames.indexOf(selected) // accountNames indexes match loginList indexes diff --git a/src/schedule-cleanup.js b/src/schedule-cleanup.js index f2ade9a..6d4c394 100644 --- a/src/schedule-cleanup.js +++ b/src/schedule-cleanup.js @@ -21,10 +21,7 @@ module.exports = ({ lockBitwardenAfter, clearClipboardAfter, sessionFile, stdout console.debug(`${sessionFile} already removed.`) } 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(() => { if(!stdout) {