refactor: use REPO_NAMES in configure_runners.sh
- Update validate_runner_repos() to check against words in REPO_NAMES - Update repos hint builder to iterate REPO_NAMES Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,8 +84,12 @@ validate_runner_path() {
|
||||
|
||||
validate_runner_repos() {
|
||||
if [[ "$1" == "all" ]]; then return 0; fi
|
||||
# Check against known REPO_*_NAME values
|
||||
[[ "$1" == "${REPO_1_NAME:-}" ]] || [[ "$1" == "${REPO_2_NAME:-}" ]] || [[ "$1" == "${REPO_3_NAME:-}" ]]
|
||||
# Check against names in REPO_NAMES
|
||||
local _rn
|
||||
for _rn in ${REPO_NAMES:-}; do
|
||||
[[ "$1" == "$_rn" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
validate_capacity() {
|
||||
@@ -443,10 +447,9 @@ for ((i = 0; i < runner_count; i++)); do
|
||||
if [[ -z "$repos_default" ]]; then repos_default="all"; fi
|
||||
# Build hint with known repo names
|
||||
repos_hint="token scope: all"
|
||||
for var in REPO_1_NAME REPO_2_NAME REPO_3_NAME; do
|
||||
if [[ -n "${!var:-}" ]]; then
|
||||
repos_hint="${repos_hint}, ${!var}"
|
||||
fi
|
||||
local _rn
|
||||
for _rn in ${REPO_NAMES:-}; do
|
||||
repos_hint="${repos_hint}, ${_rn}"
|
||||
done
|
||||
prompt_field "repos" "$repos_hint" "runner_repos" "$repos_default"
|
||||
save_runner_field "$r_name" "repos" "$PROMPT_RESULT"
|
||||
|
||||
Reference in New Issue
Block a user