refactor: replace $PERSON with local $ws in generate_gitconfig

This commit is contained in:
null 2025-05-17 17:23:09 +00:00
parent 5cf7a35311
commit 1f2d81984b

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 ".\"$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 \