From 1f2d81984bc498b8b9372bc4d7edcea812e01099 Mon Sep 17 00:00:00 2001 From: null Date: Sat, 17 May 2025 17:23:09 +0000 Subject: [PATCH] refactor: replace $PERSON with local $ws in generate_gitconfig --- ssh_router.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ssh_router.sh b/ssh_router.sh index 746c110..9f1bbff 100644 --- a/ssh_router.sh +++ b/ssh_router.sh @@ -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 \