From 663376e1ccd6790cfcd9a08941590566512188f8 Mon Sep 17 00:00:00 2001 From: S Date: Sun, 1 Mar 2026 11:59:25 -0500 Subject: [PATCH] chore: remove 4 dead functions from lib/common.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/common.sh | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index 7a3d8f9..031e574 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -123,15 +123,6 @@ 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). @@ -185,10 +176,6 @@ validate_positive_integer() { [[ "$1" =~ ^[1-9][0-9]*$ ]] } -validate_optional() { - return 0 # always valid — value can be empty or anything -} - validate_optional_path() { # shellcheck disable=SC2088 # tilde intentionally stored as literal string [[ -z "$1" ]] || [[ "$1" == /* ]] || [[ "$1" == "~/"* ]] @@ -633,24 +620,6 @@ wait_for_http() { 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 # --------------------------------------------------------------------------- @@ -931,15 +900,6 @@ manifest_record() { 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). # Usage: manifest_entries "macbook" # Outputs lines to stdout: TYPE|TARGET|DETAILS