knowledge-genome-orchestrator/lib/deps.sh

36 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# =============================================================================
# lib/deps.sh
# Dependency and environment validation.
# =============================================================================
check_deps() {
local missing=()
local required=(git git-crypt curl jq)
for cmd in "${required[@]}"; do
if ! command -v "$cmd" &>/dev/null; then
missing+=("$cmd")
fi
done
if [[ ${#missing[@]} -gt 0 ]]; then
error "Missing required tools: ${missing[*]}"
printf "\nInstall them using your package manager:\n"
printf " Debian/Ubuntu: sudo apt install %s\n" "${missing[*]}"
printf " MacOS: brew install %s\n" "${missing[*]}"
return 1
fi
success "Environment check passed: all required tools found."
if ! command -v bw &>/dev/null; then
warn "Optional tool 'bw' (Bitwarden CLI) not found. Vaultwarden integration will be manual."
fi
}
check_git_identity() {
if [[ -z "$(git config user.name)" || -z "$(git config user.email)" ]]; then
warn "Git identity not set globally. Scripts will attempt to use local config."
fi
}