fix git-crypt unlock detection

Check for .git/git-crypt/keys directory which only exists after
unlock, instead of parsing git-crypt status output which shows
"encrypted:" regardless of lock state.
This commit is contained in:
2026-03-13 12:25:18 -04:00
parent c484cb9d49
commit bb45d3ef2f
+1 -1
View File
@@ -39,7 +39,7 @@ fi
# --- Unlock git-crypt via Bitwarden --- # --- Unlock git-crypt via Bitwarden ---
cd "$REPO_DIR" cd "$REPO_DIR"
if git-crypt status 2>/dev/null | grep -q ' encrypted:'; then if [ ! -d "$REPO_DIR/.git/git-crypt/keys" ]; then
echo "==> Fetching git-crypt key from Bitwarden..." echo "==> Fetching git-crypt key from Bitwarden..."
echo " Log in to Bitwarden when prompted." echo " Log in to Bitwarden when prompted."
if bw status 2>/dev/null | grep -q '"status":"unauthenticated"'; then if bw status 2>/dev/null | grep -q '"status":"unauthenticated"'; then