feat: add boot option for native runners configuration
This commit is contained in:
@@ -179,6 +179,10 @@ prompt_field() {
|
||||
if validate_docker_memory "$value"; then break; fi
|
||||
printf '%b Invalid: must be Docker memory format (e.g. 2g, 512m) or empty%b\n' "$C_RED" "$C_RESET"
|
||||
;;
|
||||
bool)
|
||||
if [[ "$value" == "true" || "$value" == "false" ]]; then break; fi
|
||||
printf '%b Invalid: must be "true" or "false"%b\n' "$C_RED" "$C_RESET"
|
||||
;;
|
||||
ip)
|
||||
if validate_ip "$value"; then break; fi
|
||||
printf '%b Invalid IP address format (expected: x.x.x.x)%b\n' "$C_RED" "$C_RESET"
|
||||
@@ -258,10 +262,10 @@ fi
|
||||
|
||||
# Prompt count per runner:
|
||||
# name(1) + host(1) + type(1) + data_path(1) + labels(1) + default_image(1) +
|
||||
# repos(1) + capacity(1) + cpu(1) + memory(1) = 10
|
||||
# repos(1) + capacity(1) + cpu(1) + memory(1) + boot(1) = 11
|
||||
# Custom host adds: ssh_host(1) + ssh_user(1) + ssh_port(1) + ssh_key(1) = 4
|
||||
# We estimate max 10 per runner for progress display
|
||||
TOTAL_PROMPTS=$((runner_count * 10))
|
||||
# We estimate max 11 per runner for progress display
|
||||
TOTAL_PROMPTS=$((runner_count * 11))
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Configure runner definitions
|
||||
@@ -458,6 +462,23 @@ for ((i = 0; i < runner_count; i++)); do
|
||||
save_runner_field "$r_name" "memory" ""
|
||||
CURRENT_PROMPT=$((CURRENT_PROMPT + 1))
|
||||
fi
|
||||
|
||||
# --- boot (skip for docker — only applies to native macOS runners) ---
|
||||
# boot=true installs the launchd plist to /Library/LaunchDaemons/ (starts at
|
||||
# boot before login, requires sudo). boot=false installs to ~/Library/LaunchAgents/
|
||||
# (starts at login, no sudo needed).
|
||||
if [[ "$r_type" == "native" ]]; then
|
||||
boot_default=""
|
||||
if [[ -n "$ex_name" ]]; then
|
||||
boot_default=$(ini_default_get "$ex_name" "boot" "false")
|
||||
fi
|
||||
if [[ -z "$boot_default" ]]; then boot_default="false"; fi
|
||||
prompt_field "boot" "start at boot (before login)? requires sudo [true/false]" "bool" "$boot_default"
|
||||
save_runner_field "$r_name" "boot" "$PROMPT_RESULT"
|
||||
else
|
||||
save_runner_field "$r_name" "boot" ""
|
||||
CURRENT_PROMPT=$((CURRENT_PROMPT + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
# ===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user