-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
Β·51 lines (42 loc) Β· 2.31 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
Β·51 lines (42 loc) Β· 2.31 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
#!/bin/bash
# LinuxMissions installer
set -euo pipefail
cd "$(dirname "$0")"
echo ""
echo " LinuxMissions β Installer"
echo " βββββββββββββββββββββββββ"
echo ""
# βββ Python check ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if ! command -v python3 &>/dev/null; then
echo "β Python 3 is required."
echo " Ubuntu/Debian: sudo apt install python3 python3-venv"
echo " macOS: brew install python3"
exit 1
fi
PY_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
echo "β
Python $PY_VERSION found"
# βββ venv ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
if [ ! -d "venv" ]; then
echo "π¦ Creating virtual environment..."
python3 -m venv venv
fi
echo "π¦ Installing Python dependencies..."
venv/bin/pip install --upgrade pip -q
venv/bin/pip install -r requirements.txt -q
echo "β
Dependencies installed"
# βββ Generate levels.json ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo "βοΈ Generating levels.json..."
venv/bin/python3 scripts/generate_levels.py
# βββ Initial progress.json βββββββββββββββββββββββββββββββββββββββββββββββββββββ
if [ ! -f "progress.json" ]; then
echo '{"player_name":"","total_xp":0,"completed_levels":[],"current_module":"","current_level":"","module_certificates":[],"time_per_level":{},"level_start_time":null}' > progress.json
echo "β
progress.json initialized"
fi
# βββ Make scripts executable βββββββββββββββββββββββββββββββββββββββββββββββββββ
chmod +x play.sh
find modules -name "*.sh" -exec chmod +x {} \;
echo "β
Scripts made executable"
echo ""
echo " β
Installation complete!"
echo " Run: ./play.sh"
echo ""