always run git-crypt unlock instead of trying to detect lock state

This commit is contained in:
2026-03-13 12:29:01 -04:00
parent bb45d3ef2f
commit c8976e0a22
+9 -13
View File
@@ -38,21 +38,17 @@ fi
# --- Unlock git-crypt via Bitwarden --- # --- Unlock git-crypt via Bitwarden ---
cd "$REPO_DIR" echo "==> Unlocking git-crypt via Bitwarden..."
if [ ! -d "$REPO_DIR/.git/git-crypt/keys" ]; then echo " Log in to Bitwarden when prompted."
echo "==> Fetching git-crypt key from Bitwarden..." if bw status 2>/dev/null | grep -q '"status":"unauthenticated"'; then
echo " Log in to Bitwarden when prompted."
if bw status 2>/dev/null | grep -q '"status":"unauthenticated"'; then
bw login bw login
fi
BW_SESSION=$(bw unlock --raw)
bw get notes hantim-git-crypt-key --session "$BW_SESSION" | base64 -d > /tmp/git-crypt-key
git-crypt unlock /tmp/git-crypt-key
rm /tmp/git-crypt-key
bw lock
else
echo "==> git-crypt already unlocked, skipping."
fi fi
BW_SESSION=$(bw unlock --raw)
bw 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
# --- Install Docker --- # --- Install Docker ---