Repository navigation
Expand file tree
/
Copy pathstart.command
More file actions
executable file
·70 lines (61 loc) · 2.26 KB
/
Copy pathstart.command
File metadata and controls
executable file
·70 lines (61 loc) · 2.26 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
#!/bin/bash
# =============================================================================
# RETRODB - macOS Startup Script
# =============================================================================
# Double-click this file in Finder to start RetroDB
# Or run from Terminal: ./start.command
# =============================================================================
# Change to the script's directory
cd "$(dirname "$0")"
echo ""
echo "========================================================"
echo " RetroDB - Retro Gaming ROM Library Manager"
echo "========================================================"
echo ""
# Check Python
if command -v python3 &> /dev/null; then
PYTHON=python3
elif command -v python &> /dev/null; then
PYTHON=python
else
echo "ERROR: Python not found! Install from python.org or: brew install python3"
echo "Press any key to exit..."
read -n 1
exit 1
fi
echo " OK: Python found ($($PYTHON --version))"
# Resolve the port once (PORT -> RETRODB_PORT -> config default) so the banner
# matches what app.py actually binds. A malformed
# value dies here with the message from server_port.py.
if ! SERVER_PORT=$($PYTHON server_port.py); then
echo "Press any key to exit..."
read -n 1
exit 1
fi
# Check dependencies
if ! $PYTHON -c "import flask" 2>/dev/null; then
echo " Running the installer..."
# install.py prefers `--require-hashes -r requirements.lock`; a bare
# `pip install -r requirements.txt` here defeated that (Pass 59.12).
if ! $PYTHON install.py; then
echo "ERROR: dependency install failed — see the output above."
echo "Press any key to exit..."
read -n 1
exit 1
fi
fi
# Create directories
mkdir -p database logs data
mkdir -p static/images/{boxart,screenshots,systems,ratings}
# Build CSS
$PYTHON build_css.py > /dev/null 2>&1
echo ""
echo "========================================================"
echo " Starting RetroDB server..."
echo " Local: http://localhost:${SERVER_PORT}"
echo " Press Ctrl+C to stop the server"
echo "========================================================"
echo ""
# app.py opens the browser once the port is bound (skipped under
# LocalWebServerManager, which has its own Open button).
RETRODB_OPEN_BROWSER=1 $PYTHON app.py