-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·80 lines (62 loc) · 1.64 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·80 lines (62 loc) · 1.64 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
#!/bin/bash
# AutoMail Agent - Simple Setup Script
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
print_info() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check Python
if command -v python3 >/dev/null 2>&1; then
PYTHON_CMD="python3"
elif command -v python >/dev/null 2>&1; then
PYTHON_CMD="python"
else
print_error "Python is not installed. Please install Python 3.8+ and try again."
exit 1
fi
print_success "Python found"
# Check if we're in project directory
if [ ! -f "requirements.txt" ]; then
print_error "requirements.txt not found. Please run this script from the project directory."
exit 1
fi
print_info "Setting up virtual environment..."
if [ -d "venv" ]; then
rm -rf venv
fi
$PYTHON_CMD -m venv venv
source venv/bin/activate
print_success "Virtual environment created"
print_info "Installing Python dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
print_success "Python dependencies installed"
# Set up basic permissions
print_info "Setting up permissions..."
if [ -d "$HOME/.cache/ms-playwright" ]; then
chmod -R 755 "$HOME/.cache/ms-playwright" 2>/dev/null || true
fi
# Allow X11 access if display exists
if [ -n "$DISPLAY" ]; then
xhost +local: >/dev/null 2>&1 || true
fi
print_success "Permissions configured"
# Create simple start script
cat > start.sh << 'EOF'
#!/bin/bash
source venv/bin/activate
python3 -m main
EOF
chmod +x start.sh
print_success "Setup complete!"
echo "Run: ./start.sh or python3 -m main (after activating venv)"