seanfarley / emacs-bitwarden

Emacs Bitwarden command wrapper.
GNU General Public License v3.0
47 stars 13 forks source link

cond: Wrong type argument: stringp, nil #20

Open jsilve24 opened 9 months ago

jsilve24 commented 9 months ago

I started getting this warning after upgrading to newest version (on AUR) of bw-cli and emacs-bitwarden. I tracked the error down.

Relevant error in bw-cli https://github.com/bitwarden/clients/issues/7126

What this is causing:

The bw cli is giving the following error:

Error: Lock file is already being held
    at /usr/lib/node_modules/@bitwarden/cli/node_modules/proper-lockfile/lib/lockfile.js:68:47
    at callback (/usr/lib/node_modules/@bitwarden/cli/node_modules/graceful-fs/polyfills.js:306:20)
    at FSReqCallback.oncomplete (node:fs:211:5) {
  code: 'ELOCKED',
  file: '/home/jds6696/.config/Bitwarden CLI/data.json'
}

Node.js v18.18.2

which is causing exit-code to equal 1 and within the bitwarden-runcmd function which then gets pickuped but misshandled within the follwing if form

(if (eq exit-code 0)
output
(cond ...)) 

What works for me is replacing (eq exit-code 0) with t for the moment.

I am sure there is a better solution that bypasses this error and also doesn't simply remove the functionality of this clause but this worked for me.

Hope this helps.

seanfarley commented 9 months ago

Thanks for the report! I just noticed this as well. I've been wanting to rewrite this package to use the REST server that is built into bw-cli which would circumvent a lot of these types of errors. Just need more hours in the day 😞