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

Commit

Permalink
fixes the failing check for BW_EXEC by exporting PATH before checking…
Browse files Browse the repository at this point in the history
… with `hash` (#185)

* fixes typo in bash variable name
* set PATH before looking for CLI executable

---------

Co-authored-by: Wolfgang Miller-Reichling <[email protected]>
  • Loading branch information
wollew and Wolfgang Miller-Reichling authored Dec 8, 2023
1 parent 30541fb commit 42d93d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion workflow/bw_auto_lock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ alfred_workflow_version=$(_get_var_from_plist "${infoplist}" version)
echo "found workflow v${alfred_workflow_version} at ${wf_dir}" 1>&2
WF_PATH=$(_get_var_from_plist "${prefsplist}" PATH)
[ -n "${WF_PATH}" ] || { echo "Bitwarden CLI Path not set in workflow configuration"; exit 1; }
export PATH=${WF_PATH}
BW_EXEC=$(_get_var_from_plist "${infoplist}" variables.BW_EXEC)
if ! hash "${BW_EXEC}" 2>/dev/null; then
echo "bw command not found, check PATH env variable"; exit 1;
Expand All @@ -112,7 +113,6 @@ export alfred_workflow_bundleid
export alfred_workflow_cache
export alfred_workflow_data
export alfred_workflow_version
export PATH=${WF_PATH}
export BW_EXEC

case $1 in
Expand Down

0 comments on commit 42d93d6

Please sign in to comment.