Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Value of the BW_DATA_PATH variable seems to be ignored #151

Open
sellmerfud opened this issue Mar 4, 2023 · 2 comments
Open

Value of the BW_DATA_PATH variable seems to be ignored #151

sellmerfud opened this issue Mar 4, 2023 · 2 comments

Comments

@sellmerfud
Copy link

No matter what value I assign to the BW_DATA_PATH value in the Workflow Environment Variables, the workflow always seems to the use the default value of ~/Library/Application Support/Bitwarden CLI/data.json

@blacs30
Copy link
Owner

blacs30 commented Mar 4, 2023

Thanks for creating an issue.
I have not used this var myself i believe. Can you check the debug output:

                debugLog(fmt.Sprintf("bwDataPath is: %s", bwDataPath)) 
         }

It should print the path which is set.

@sellmerfud
Copy link
Author

I looked into this a bit deeper and it seems that your program is using bwDataPath to read the data.json for its own purposes, but it is not putting it in the environment variable BITWARDENCLI_APPDATA_DIR before executing the bw command line program.

The bw command line program checks this environment variable to override the default location of the data.json file.
So when using your Alfred Workflow, the bw program is always using the default data.json.

It would be nice if your workflow set the environment variable before runing the bw program so that it uses data.json that is configured in your workflow.

Also, BITWARDENCLI_APPDATA_DIR specifies the directory where the data.json file resides. (Not the full path to the file) The name of the file is always data.json. I don't think there is any way to use a different file name.

I like having a separate data.json files for the Alfred workflow and for my own use of bw from the command line.
I have solved this by setting BITWARDENCLI_APPDATA_DIR in my bash.profile and allowing the workflow to use the default location. So I'm good with it as is. But is would be nice if the setting in the workflow worked consistently.

BTW, I really like your workflow. Really well designed and it works quickly. Thanks for putting in the work and making it available.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants