Compare commits

...

2 Commits

Author SHA1 Message Date
null
1f2d81984b refactor: replace $PERSON with local $ws in generate_gitconfig 2025-05-17 17:23:09 +00:00
null
5cf7a35311 fix: update generate_gitconfig to use go-yq without -r flag 2025-05-17 17:22:13 +00:00

View File

@@ -92,16 +92,17 @@ esac
# ─────────────────────────────────────────────
# Generate per-user gitconfig
generate_gitconfig() {
local ws="$1"
local access="$HOME/access.yml"
local template="$HOME/gitconfig.template"
local userdir="$HOME/secrets/$PERSON"
local userdir="$HOME/secrets/$ws"
local name email
name=$(yq -r ".\"$PERSON\".name" "$access" 2>/dev/null || echo)
email=$(yq -r ".\"$PERSON\".email" "$access" 2>/dev/null || echo)
name=$(yq ".\"$ws\".name" "$access" 2>/dev/null || echo)
email=$(yq ".\"$ws\".email" "$access" 2>/dev/null || echo)
if [[ -z "$name" || -z "$email" ]]; then
log ERROR "Missing name/email for '$PERSON' in $access"
log ERROR "Missing name/email for '$ws' in $access"
exit 1
fi
@@ -116,7 +117,7 @@ generate_gitconfig() {
start_container_if_needed() {
if ! podman container exists "$WORKSPACE"; then
log INFO "Creating container '$WORKSPACE'"
generate_gitconfig
generate_gitconfig "$PERSON"
podman run -dit \
--name "$WORKSPACE" \
--userns=keep-id \