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 ---