-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
55 lines (47 loc) · 1.38 KB
/
setup.sh
File metadata and controls
55 lines (47 loc) · 1.38 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
#!/bin/bash
# OpenCode Quick Setup Script
# One-command setup for the collaborative coding platform
echo "🚀 OpenCode Quick Setup"
echo "======================"
echo ""
# Check if Python is installed
if command -v python3 &> /dev/null; then
PYTHON_CMD="python3"
elif command -v python &> /dev/null; then
PYTHON_CMD="python"
else
echo "❌ Python is not installed. Please install Python first."
echo " Visit: https://www.python.org/downloads/"
exit 1
fi
# Create images directory if it doesn't exist
echo "📁 Creating necessary directories..."
mkdir -p images/favicon
# Create placeholder favicon files to avoid 404 errors
touch images/favicon/favicon-16x16.png
touch images/favicon/favicon-32x32.png
# Find an available port
PORT=8000
while lsof -Pi :$PORT -sTCP:LISTEN -t >/dev/null 2>&1 ; do
echo "⚠️ Port $PORT is in use, trying port $((PORT + 1))..."
PORT=$((PORT + 1))
done
echo "✅ Setup complete!"
echo ""
echo "🌐 Starting server on port $PORT..."
echo "=================================="
echo ""
echo "📝 Access the app at: http://localhost:$PORT"
echo ""
echo "🔐 Admin credentials:"
echo " Email: admin@opencode.com"
echo " Password: admin123"
echo ""
echo "Press Ctrl+C to stop the server"
echo ""
# Start the server
if [ "$PYTHON_CMD" = "python3" ]; then
$PYTHON_CMD -m http.server $PORT
else
$PYTHON_CMD -m SimpleHTTPServer $PORT
fi