#!/usr/bin/env bash
set -euo pipefail

have() { command -v "$1" >/dev/null 2>&1; }

printf 'Doris Kitchen environment check\n'
printf '==============================\n'

for cmd in python3 docker curl; do
  if have "$cmd"; then
    printf '%-10s %s\n' "$cmd" "$(command -v "$cmd")"
  else
    printf '%-10s %s\n' "$cmd" "MISSING"
  fi
done

python3 - <<'PY'
import importlib.util
mods = ['fastapi', 'uvicorn', 'jinja2']
for mod in mods:
    print(f'{mod:10} ', 'installed' if importlib.util.find_spec(mod) else 'MISSING')
PY

