-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·62 lines (53 loc) · 1.66 KB
/
setup.sh
File metadata and controls
executable file
·62 lines (53 loc) · 1.66 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
#!/usr/bin/env bash
set -e
echo "🚀 Starting environment setup..."
# Install Python
if ! command -v python3 &>/dev/null; then
echo "⚠️ Python3 not found. Please install Python 3.8+ manually."
exit 1
fi
echo "✅ Python version: $(python3 --version)"
# Install Node.js + npm
if ! command -v npm &>/dev/null; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "⚠️ npm not found. Installing Node.js..."
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install node
else
echo "❌ Unsupported OS for automatic Node.js install"
exit 1
fi
fi
echo "✅ Node.js version: $(node -v)"
echo "✅ npm version: $(npm -v)"
# Create virtual environment
if [ ! -d ".venv" ]; then
python3 -m venv .venv
echo "✅ Created virtual environment in .venv"
fi
# Activate virtual environment
source .venv/bin/activate
echo "✅ Activated virtual environment"
# Install Python Dependencies
if [ -f "requirements.txt" ]; then
pip install --upgrade pip
pip install -r requirements.txt
echo "✅ Installed Python dependencies"
else
echo "⚠️ No requirements.txt found, skipping Python deps install"
fi
# Install npm Dependencies
if [ -f "package.json" ]; then
npm install
echo "✅ Installed npm dependencies"
else
echo "⚠️ No package.json found, skipping npm deps install"
fi
# Install Playwright & browser dependencies
echo "📦 Installing Playwright..."
npm install -D playwright
npx playwright install --with-deps
echo "✅ Playwright installed with dependencies"
echo "🎉 Setup complete!"