-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·128 lines (115 loc) · 3.59 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·128 lines (115 loc) · 3.59 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
# =============================================================================
# EduStack Setup
# Validates the environment and prepares EduStack for use.
# INSTALLS NOTHING. Only checks that required tools are available.
# Safe to run on school computers without admin privileges.
# =============================================================================
set -euo pipefail
echo ""
echo " ============================================="
echo " EduStack Setup"
echo " ============================================="
echo ""
ISSUES=0
# --- Check: Git ---
echo -n " Checking Git... "
if command -v git &>/dev/null; then
GIT_VERSION=$(git --version 2>/dev/null | head -1)
echo "OK ($GIT_VERSION)"
else
echo "NOT FOUND"
echo " → Install Git: https://git-scm.com/"
ISSUES=$((ISSUES + 1))
fi
# --- Check: Text editor ---
echo -n " Checking for a text editor... "
EDITOR_FOUND=false
for editor in code nano vim vi notepad++; do
if command -v "$editor" &>/dev/null; then
echo "OK ($editor found)"
EDITOR_FOUND=true
break
fi
done
if [ "$EDITOR_FOUND" = false ]; then
echo "NONE DETECTED"
echo " → Recommended: VS Code (https://code.visualstudio.com/)"
echo " → Any text editor works (Notepad, TextEdit, etc.)"
fi
# --- Check: Browser ---
echo -n " Checking for a web browser... "
BROWSER_FOUND=false
for browser in google-chrome chromium firefox microsoft-edge safari; do
if command -v "$browser" &>/dev/null; then
echo "OK ($browser found)"
BROWSER_FOUND=true
break
fi
done
if [ "$BROWSER_FOUND" = false ]; then
echo "NOT DETECTED (but probably installed)"
echo " → Any modern browser works: Chrome, Firefox, Edge, Safari"
fi
# --- Make scripts executable ---
echo -n " Making scripts executable... "
chmod +x scripts/*.sh 2>/dev/null || true
echo "OK"
# --- Create config directory ---
echo -n " Creating config directory... "
mkdir -p config
echo "OK"
# --- Create default teacher settings if not present ---
if [ ! -f "config/teacher-settings.json" ]; then
echo -n " Creating default teacher settings... "
cat > config/teacher-settings.json << 'EOF'
{
"ai_enabled": false,
"content_filter_strictness": "high",
"audit_logging": true,
"log_retention_days": 30,
"student_code_sharing": false,
"notes": "Edit this file to customize EduStack for your classroom."
}
EOF
echo "OK"
else
echo " Teacher settings already exist (not overwritten)"
fi
# --- Create logs directory ---
echo -n " Creating logs directory... "
mkdir -p logs
if [ ! -f "logs/.gitignore" ]; then
echo "*" > logs/.gitignore
echo "!.gitignore" >> logs/.gitignore
fi
echo "OK"
# --- Create student work directory ---
echo -n " Creating student work directory... "
mkdir -p student-work
if [ ! -f "student-work/.gitignore" ]; then
echo "*" > student-work/.gitignore
echo "!.gitignore" >> student-work/.gitignore
fi
echo "OK"
# --- Summary ---
echo ""
if [ $ISSUES -eq 0 ]; then
echo " ============================================="
echo " Setup complete! EduStack is ready."
echo " ============================================="
echo ""
echo " Next steps:"
echo " 1. Read docs/TEACHER-GUIDE.md (10 min)"
echo " 2. Open skills/learn/SKILL-01-hello-world.md"
echo " 3. Try the first few steps yourself"
echo ""
echo " Happy teaching!"
else
echo " ============================================="
echo " Setup found $ISSUES issue(s)."
echo " Fix them and run ./setup.sh again."
echo " ============================================="
fi
echo ""
exit $ISSUES