From c8976e0a226a329031fed7d7b8e34aad0d4d278f Mon Sep 17 00:00:00 2001 From: Timothy Kim Date: Fri, 13 Mar 2026 12:29:01 -0400 Subject: [PATCH] always run git-crypt unlock instead of trying to detect lock state --- setup.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/setup.sh b/setup.sh index 42d531c..6fd52b5 100644 --- a/setup.sh +++ b/setup.sh @@ -38,21 +38,17 @@ fi # --- Unlock git-crypt via Bitwarden --- -cd "$REPO_DIR" -if [ ! -d "$REPO_DIR/.git/git-crypt/keys" ]; then - echo "==> Fetching git-crypt key from Bitwarden..." - echo " Log in to Bitwarden when prompted." - if bw status 2>/dev/null | grep -q '"status":"unauthenticated"'; then - 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." +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 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 ---