feat: add version checking and install manifest tracking

Add minimum version validation for all dependencies across local and
remote machines (jq>=1.6, curl>=7.70, git>=2.30, docker>=20.0,
compose>=2.0, shellcheck>=0.8, gh>=2.0). Setup scripts now record
every install action to .manifests/<host>.manifest files, enabling
full rollback via setup/cleanup.sh. teardown_all.sh gains --cleanup
flag to chain prerequisite removal after phase teardowns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-02-26 19:35:09 -06:00
parent 720197bb10
commit 07d27f7a9c
9 changed files with 605 additions and 3 deletions

View File

@@ -15,6 +15,11 @@ log_info "=== MacBook Setup ==="
# --------------------------------------------------------------------------
require_local_os "Darwin" "macbook.sh must run on macOS — detected a non-macOS system"
# --------------------------------------------------------------------------
# Manifest — track what we install for rollback/cleanup
# --------------------------------------------------------------------------
manifest_init "macbook"
# --------------------------------------------------------------------------
# Homebrew
# --------------------------------------------------------------------------
@@ -37,10 +42,21 @@ for pkg in "${BREW_PACKAGES[@]}"; do
else
log_info "Installing $pkg..."
brew install "$pkg"
manifest_record "macbook" "brew_pkg" "$pkg"
log_success "$pkg installed"
fi
done
# --------------------------------------------------------------------------
# Minimum version checks for local tools
# --------------------------------------------------------------------------
log_info "Checking minimum versions..."
check_min_version "jq" "jq --version" "1.6"
check_min_version "curl" "curl --version" "7.70"
check_min_version "git" "git --version" "2.30"
check_min_version "shellcheck" "shellcheck --version" "0.8"
check_min_version "gh" "gh --version" "2.0"
# --------------------------------------------------------------------------
# Verify built-in tools
# --------------------------------------------------------------------------
@@ -70,6 +86,7 @@ if xcode-select -p &>/dev/null; then
else
log_info "Installing Xcode Command Line Tools..."
xcode-select --install
manifest_record "macbook" "xcode_cli" "xcode-select"
log_warn "Xcode CLI Tools installation started. Wait for it to finish, then re-run this script."
exit 0
fi