Skip to content

Commit

Permalink
Add debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Luzifer committed Sep 16, 2024
1 parent f7bfd28 commit 9775501
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/bash

exec >>/tmp/checkout 2>&1

echo -e "\n\n+++ $@"

source /git-crypt-vault/env.sh

$(dirname $0)/git.bin "$@"
EC=$?

if [ "$1" = "checkout" -a -f ".git-crypt-key" -a ! "$GIT_CRYPT_RUNNING" = "true" ]; then
export GIT_CRYPT_RUNNING=true
export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id="${VAULT_ROLE_ID:-}")
export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id="${VAULT_ROLE_ID}")

tmpfile=$(mktemp)
vault read -field=key "secret/git-crypt/$(<.git-crypt-key)" | base64 -d >${tmpfile}
Expand Down

0 comments on commit 9775501

Please sign in to comment.