40 lines
1.3 KiB
Bash
40 lines
1.3 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
|
|
|
|
if ! command -v python3 &>/dev/null; then
|
|
warn "Optional tool 'python3' not found. Needed for 'make test' and the ingest skill (index-append.py), not for setup."
|
|
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
|
|
}
|