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 ---
|
# --- 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."
|
bw login
|
||||||
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."
|
|
||||||
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 ---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user