From 87fefe28a1de5a7f05e4a9a93add43f1e96ab388 Mon Sep 17 00:00:00 2001 From: S Date: Sun, 1 Mar 2026 10:04:57 -0500 Subject: [PATCH] feat: add get_repo_list() and replace REPO_N_NAME with REPO_NAMES in validation - Add get_repo_list() helper to split space-delimited REPO_NAMES - Replace REPO_1_NAME/REPO_2_NAME/REPO_3_NAME with single REPO_NAMES in _ENV_VAR_NAMES and _ENV_VAR_TYPES validation arrays Co-Authored-By: Claude Opus 4.6 --- lib/common.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index f089155..29d7767 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -123,6 +123,15 @@ require_vars() { done } +# Split REPO_NAMES (space-delimited) into one name per line. +# Usage: while IFS= read -r repo; do ...; done < <(get_repo_list) +# or: read -ra REPOS <<< "$REPO_NAMES" (for array-style usage) +get_repo_list() { + local repos=() + read -ra repos <<< "${REPO_NAMES:-}" + printf '%s\n' "${repos[@]}" +} + # --------------------------------------------------------------------------- # .env value validators — shared by configure_env.sh, preflight.sh, # bitwarden_to_env.sh. Each returns 0 (valid) or 1 (invalid). @@ -202,7 +211,7 @@ _ENV_VAR_NAMES=( BACKUP_STORAGE_PATH BACKUP_RETENTION_COUNT RUNNER_DEFAULT_IMAGE RUNNER_DEFAULT_CAPACITY RUNNER_DEFAULT_DATA_PATH LOCAL_RUNNER_DATA_PATH GITHUB_USERNAME GITHUB_TOKEN - REPO_1_NAME REPO_2_NAME REPO_3_NAME + REPO_NAMES MIGRATE_ISSUES MIGRATE_LABELS MIGRATE_MILESTONES MIGRATE_WIKI GITHUB_MIRROR_INTERVAL NGINX_CONTAINER_NAME NGINX_CONF_PATH SSL_MODE @@ -222,7 +231,7 @@ _ENV_VAR_TYPES=( path integer nonempty positive_integer nonempty nonempty nonempty nonempty - nonempty nonempty nonempty + nonempty bool bool bool bool nonempty nonempty path ssl_mode