always run git-crypt unlock instead of trying to detect lock state
This commit is contained in:
@@ -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 ---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user