-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_gui.sh
More file actions
55 lines (44 loc) · 1.56 KB
/
run_gui.sh
File metadata and controls
55 lines (44 loc) · 1.56 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
#!/bin/bash
# macOS/Linux script to run CuePoint GUI application
# Equivalent to run_gui.bat on Windows
# Note: On macOS, use run_gui.command for double-click execution
# Get the directory where this script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Prefer project-local venv for a ship-ready, consistent runtime
PY="$SCRIPT_DIR/.venv/bin/python"
if [ -x "$PY" ]; then
echo "Using project virtualenv: $PY"
else
PY="$(command -v python3)"
fi
if [ -z "$PY" ]; then
echo "Error: python3 is not installed or not in PATH"
echo "Recommended: install Python 3.11+ (OpenSSL-backed) and create .venv"
exit 1
fi
# Show SSL backend (helps detect LibreSSL vs OpenSSL)
"$PY" -c "import ssl; print('Python:', __import__('sys').version.split()[0]); print('SSL:', ssl.OPENSSL_VERSION)" 2>/dev/null
# Ensure Playwright and Chromium are installed (for inCrate Add to playlist browser fallback)
if ! "$PY" -c "import playwright" 2>/dev/null; then
echo "Playwright not found. Installing..."
"$PY" -m pip install playwright
fi
echo "Ensuring Chromium for Playwright..."
"$PY" -m playwright install chromium
# Change to src directory
cd "$SCRIPT_DIR/src" || {
echo "Error: Could not change to src directory"
exit 1
}
# Run the GUI application
echo "Starting CuePoint GUI..."
"$PY" gui_app.py
# Capture exit code
EXIT_CODE=$?
# If there was an error, wait for user input before closing
if [ $EXIT_CODE -ne 0 ]; then
echo ""
echo "Application exited with error code: $EXIT_CODE"
read -p "Press Enter to close..."
fi
exit $EXIT_CODE