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