chore: remove 4 dead functions from lib/common.sh

get_repo_list() — never called, scripts use read -ra directly
wait_for_ssh() — never called, scripts use ssh_check
validate_optional() — never called, optional type unused in arrays
manifest_exists() — never called

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-03-01 11:59:25 -05:00
parent 8cf762c465
commit 663376e1cc

View File

@@ -123,15 +123,6 @@ require_vars() {
done 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, # .env value validators — shared by configure_env.sh, preflight.sh,
# bitwarden_to_env.sh. Each returns 0 (valid) or 1 (invalid). # bitwarden_to_env.sh. Each returns 0 (valid) or 1 (invalid).
@@ -185,10 +176,6 @@ validate_positive_integer() {
[[ "$1" =~ ^[1-9][0-9]*$ ]] [[ "$1" =~ ^[1-9][0-9]*$ ]]
} }
validate_optional() {
return 0 # always valid — value can be empty or anything
}
validate_optional_path() { validate_optional_path() {
# shellcheck disable=SC2088 # tilde intentionally stored as literal string # shellcheck disable=SC2088 # tilde intentionally stored as literal string
[[ -z "$1" ]] || [[ "$1" == /* ]] || [[ "$1" == "~/"* ]] [[ -z "$1" ]] || [[ "$1" == /* ]] || [[ "$1" == "~/"* ]]
@@ -633,24 +620,6 @@ wait_for_http() {
return 1 return 1
} }
wait_for_ssh() {
local host_key="$1" max_secs="${2:-60}"
local elapsed=0
log_info "Waiting for SSH to ${host_key} (timeout: ${max_secs}s)..."
while [[ $elapsed -lt $max_secs ]]; do
if ssh_check "$host_key"; then
log_success "SSH to ${host_key} connected (after ${elapsed}s)"
return 0
fi
sleep 2
elapsed=$((elapsed + 2))
done
log_error "Timeout waiting for SSH to ${host_key} after ${max_secs}s"
return 1
}
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Version checking # Version checking
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@@ -931,15 +900,6 @@ manifest_record() {
printf '%s\n' "$entry" >> "$file" printf '%s\n' "$entry" >> "$file"
} }
# Check if a manifest file exists and has entries (beyond the header).
# Usage: manifest_exists "macbook"
manifest_exists() {
local host="$1"
local file
file="$(_manifest_dir)/${host}.manifest"
[[ -f "$file" ]] && grep -qv '^#' "$file" 2>/dev/null
}
# Read all entries from a manifest (skipping comments). # Read all entries from a manifest (skipping comments).
# Usage: manifest_entries "macbook" # Usage: manifest_entries "macbook"
# Outputs lines to stdout: TYPE|TARGET|DETAILS # Outputs lines to stdout: TYPE|TARGET|DETAILS