use full path for bw CLI since /usr/local/bin may not be in PATH

This commit is contained in:
2026-03-13 14:54:41 -04:00
parent d3d93a61b7
commit c528573b49
+8 -7
View File
@@ -35,7 +35,8 @@ echo "==> Installing dependencies..."
dnf install -y git-crypt
dnf module install -y nodejs:20/common
if ! command -v bw &>/dev/null; then
BW_CLI="$(npm config get prefix)/bin/bw"
if [ ! -x "$BW_CLI" ]; then
echo "==> Installing Bitwarden CLI..."
npm install -g @bitwarden/cli
fi
@@ -47,16 +48,16 @@ cd "$REPO_DIR" && git checkout -- .
echo "==> Unlocking git-crypt via Bitwarden..."
echo " Log in to Bitwarden when prompted."
if bw status 2>/dev/null | grep -q '"status":"unauthenticated"'; then
bw login
if "$BW_CLI" status 2>/dev/null | grep -q '"status":"unauthenticated"'; then
"$BW_CLI" login
fi
BW_SESSION=$(bw unlock --raw)
bw sync --session "$BW_SESSION"
bw get notes hantim-git-crypt-key --session "$BW_SESSION" | base64 -d > /tmp/git-crypt-key
BW_SESSION=$("$BW_CLI" unlock --raw)
"$BW_CLI" sync --session "$BW_SESSION"
"$BW_CLI" get notes hantim-git-crypt-key --session "$BW_SESSION" | base64 -d > /tmp/git-crypt-key
cd "$REPO_DIR"
git-crypt unlock /tmp/git-crypt-key
rm /tmp/git-crypt-key
bw lock
"$BW_CLI" lock
# --- Install Docker ---