From cc9863fa8f865fd92d9fcd4ed47e23c24a979db0 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Sun, 20 Sep 2026 22:25:05 +0200 Subject: bokftui-bw: default to the checkout's build/bokftui --- scripts/bokftui-bw | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/bokftui-bw b/scripts/bokftui-bw index 7bc07fe..985714d 100755 --- a/scripts/bokftui-bw +++ b/scripts/bokftui-bw @@ -12,6 +12,8 @@ # BOKF_BW_FIELD custom field that holds the secret (default: login.password) # BOKF_BW_KIND password (default) exports BOKFD_PASSWORD; # token exports BOKFD_TOKEN +# BOKFTUI binary to exec (default: build/bokftui in the checkout the +# script lives in, else bokftui from PATH) # # Works with the official Bitwarden CLI (bw) or with rbw. With bw the session # key is cached in ~/.cache/bokf/bw-session (mode 0600) so the master password @@ -25,7 +27,15 @@ if [ -z "$item" ] && [ "$#" -gt 0 ]; then fi field="${BOKF_BW_FIELD:-}" kind="${BOKF_BW_KIND:-password}" -BOKFTUI="${BOKFTUI:-bokftui}" +BOKFTUI="${BOKFTUI:-}" +if [ -z "$BOKFTUI" ]; then + root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) + if [ -x "$root/build/bokftui" ]; then + BOKFTUI="$root/build/bokftui" + else + BOKFTUI=bokftui + fi +fi # $1: newline-separated "idlabel" rows; prints the chosen id. choose_item() { -- cgit v1.3