From f367759f30f43d0f18c4fa3e7160a3ee5604e261 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Thu, 17 Sep 2026 22:39:48 +0200 Subject: scripts: probe and set the Node Web Crypto flag for bw --- scripts/bokftui-bw | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/bokftui-bw b/scripts/bokftui-bw index 284828f..a067581 100755 --- a/scripts/bokftui-bw +++ b/scripts/bokftui-bw @@ -27,6 +27,12 @@ if command -v rbw >/dev/null 2>&1; then secret=$(rbw get "$item") fi elif command -v bw >/dev/null 2>&1; then + # The SDK's WASM crypto needs the Web Crypto global; Node < 19 only has + # it with this flag. Probe with a local command instead of guessing. + if ! bw generate -uln --length 1 >/dev/null 2>&1; then + NODE_OPTIONS="${NODE_OPTIONS:-} --experimental-global-webcrypto" + export NODE_OPTIONS + fi umask 077 cache="${XDG_CACHE_HOME:-$HOME/.cache}/bokf/bw-session" if [ -f "$cache" ]; then -- cgit v1.3