forked from WEIFENG2333/VideoCaptioner
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·54 lines (46 loc) · 1.38 KB
/
run.sh
File metadata and controls
executable file
·54 lines (46 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
#!/bin/bash
# VideoCaptioner Launcher for macOS/Linux
# Check Python installation
if ! command -v python3 &> /dev/null && ! command -v python &> /dev/null; then
echo "Error: Python not found. Please install Python 3.8+"
echo "macOS: brew install python3"
echo "Linux: sudo apt install python3 python3-pip python3-venv"
exit 1
fi
# Determine Python command
if command -v python3 &> /dev/null; then
PYTHON_CMD="python3"
PIP_CMD="pip3"
else
PYTHON_CMD="python"
PIP_CMD="pip"
fi
# Check if main.py exists
if [ ! -f "main.py" ]; then
echo "Error: main.py not found. Please run from project root."
exit 1
fi
# Create virtual environment if not exists
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
$PYTHON_CMD -m venv venv
fi
# Activate virtual environment
source venv/bin/activate
# Check and install dependencies
if ! $PYTHON_CMD -c "import PyQt5" 2>/dev/null; then
echo "Installing dependencies..."
pip install -r requirements.txt
fi
# macOS specific checks
if [[ "$OSTYPE" == "darwin"* ]]; then
if ! command -v ffmpeg &> /dev/null; then
echo "Warning: ffmpeg not found. Install with: brew install ffmpeg"
fi
if ! command -v aria2c &> /dev/null; then
echo "Warning: aria2 not found. Install with: brew install aria2"
fi
fi
# Run the application
echo "Starting VideoCaptioner..."
$PYTHON_CMD main.py