bitwarden-alfred-workflow
bitwarden-alfred-workflow copied to clipboard
Value of the BW_DATA_PATH variable seems to be ignored
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
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.
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.