-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·51 lines (41 loc) · 1.13 KB
/
Copy pathinit.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.13 KB
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
45
46
47
48
49
50
51
#!/usr/bin/env bash
set -euo pipefail
REPO_URL="https://github.com/go-fireball/loop.git"
START_ROLE="${1:-PLANNER}"
TMPDIR="$(mktemp -d)"
cleanup() { rm -rf "$TMPDIR"; }
trap cleanup EXIT
echo "Cloning loop repo into temp directory ..."
git clone --depth 1 "$REPO_URL" "$TMPDIR/loop"
echo "Copying scripts/ ..."
mkdir -p scripts
cp -r "$TMPDIR/loop/scripts/"* scripts/
chmod +x scripts/*.sh
echo "Copying ai/defaults/ ..."
mkdir -p ai/defaults
cp -r "$TMPDIR/loop/ai/defaults/"* ai/defaults/
if [[ ! -f "ai/defaults/goal.yaml" ]]; then
echo "Error: ai/defaults/goal.yaml is missing after copy."
echo "Init cannot continue without required defaults."
exit 1
fi
echo "Running bootstrap with role: ${START_ROLE} ..."
bash scripts/bootstrap.sh "$START_ROLE"
required_seed_files=(
"ai/goal.yaml"
"ai/judgment.yaml"
"ai/constitution.yaml"
"ai/backlog.yaml"
"ai/active_item.yaml"
)
missing=0
for f in "${required_seed_files[@]}"; do
if [[ ! -f "$f" ]]; then
echo "Error: expected seeded file missing: $f"
missing=1
fi
done
if [[ "$missing" -ne 0 ]]; then
echo "Bootstrap did not produce all required seed files."
exit 1
fi