File size: 884 Bytes
944b4e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -euo pipefail

usage() {
  cat <<'USAGE'
Usage: ./scripts/bootstrap.sh [--quick]

Bootstraps Jarvis on a clean host:
- ensures uv is installed
- syncs dependencies
- creates .env from .env.example if missing
- runs baseline validation (unless --quick)
USAGE
}

quick=false
if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
  usage
  exit 0
fi
if [[ "${1:-}" == "--quick" ]]; then
  quick=true
fi

if ! command -v uv >/dev/null 2>&1; then
  echo "Installing uv..."
  curl -LsSf https://astral.sh/uv/install.sh | sh
  export PATH="$HOME/.local/bin:$PATH"
fi

if [[ ! -f .env && -f .env.example ]]; then
  cp .env.example .env
  echo "Created .env from .env.example"
fi

uv sync --extra dev

if [[ "$quick" == "false" ]]; then
  uv run ruff check src tests
  uv run pytest -q tests/test_config.py tests/test_tools_services.py
fi

echo "Bootstrap complete."