-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·89 lines (80 loc) · 2.43 KB
/
setup.sh
File metadata and controls
executable file
·89 lines (80 loc) · 2.43 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
#!/bin/bash
# Halo Game Platform - Initial Setup Script
# This script prepares the environment for first-time users
echo "🎮 HALO GAME PLATFORM - SETUP"
echo "=============================="
echo ""
# Check Java version
echo "Checking Java installation..."
if command -v java >/dev/null 2>&1; then
JAVA_VERSION=$(java -version 2>&1 | head -n 1 | cut -d '"' -f 2)
echo "✅ Java found: $JAVA_VERSION"
else
echo "❌ Java not found. Please install Java 8 or higher."
echo " Visit: https://adoptium.net/"
exit 1
fi
# Check Python version
echo ""
echo "Checking Python installation..."
if command -v python3 >/dev/null 2>&1; then
PYTHON_VERSION=$(python3 --version | cut -d ' ' -f 2)
echo "✅ Python 3 found: $PYTHON_VERSION"
else
echo "❌ Python 3 not found. Please install Python 3.6 or higher."
echo " Visit: https://www.python.org/downloads/"
exit 1
fi
# Check for jq (optional but recommended)
echo ""
echo "Checking optional dependencies..."
if command -v jq >/dev/null 2>&1; then
echo "✅ jq found (JSON processor)"
else
echo "⚠️ jq not found (optional). Install for pretty JSON output:"
echo " macOS: brew install jq"
echo " Ubuntu: sudo apt-get install jq"
fi
# Make all scripts executable
echo ""
echo "Making demo scripts executable..."
find demos -name "*.sh" -exec chmod +x {} \;
chmod +x java-rest-api/run_server.py
chmod +x java-rest-api/run_halo_server.py
echo "✅ All scripts are now executable"
# Check if JAR exists
echo ""
echo "Checking for pre-built JAR..."
if [ -f "java-rest-api/target/gameauth-0.0.1-SNAPSHOT.jar" ]; then
echo "✅ Pre-built JAR found. No compilation needed!"
else
echo "⚠️ JAR not found. Building from source..."
if command -v mvn >/dev/null 2>&1; then
cd java-rest-api
mvn clean package -DskipTests
cd ..
echo "✅ Build complete!"
else
echo "❌ Maven not found. Cannot build from source."
echo " Please ensure the JAR file is present or install Maven."
exit 1
fi
fi
# Create logs directory
mkdir -p demos/logs
echo ""
echo "✅ Logs directory created"
echo ""
echo "=================================="
echo "🎉 SETUP COMPLETE!"
echo "=================================="
echo ""
echo "To start the server:"
echo " cd java-rest-api"
echo " python3 run_halo_server.py"
echo ""
echo "To run a quick demo:"
echo " cd demos"
echo " ./quick-demo.sh"
echo ""
echo "Happy gaming! 🎮"