-
Notifications
You must be signed in to change notification settings - Fork 25
/
setup.sh
69 lines (54 loc) · 1.88 KB
/
setup.sh
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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
echo "Starting setup..."
# 1. Install Homebrew if not installed
if ! command_exists brew; then
echo "Homebrew not found. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Homebrew is already installed."
fi
# 2. Install System Dependencies
echo "Installing system dependencies..."
brew install cliclick imagemagick
# 3. Install Rust and Cargo if not installed
if ! command_exists cargo; then
echo "Rust and Cargo not found. Installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Source cargo environment (you may need to restart the terminal)
source "$HOME/.cargo/env"
else
echo "Rust and Cargo are already installed."
fi
# 4. Install Xcode Command Line Tools if not installed
if ! xcode-select -p >/dev/null 2>&1; then
echo "Installing Xcode Command Line Tools..."
xcode-select --install
else
echo "Xcode Command Line Tools are already installed."
fi
# 5. Set Up Python Virtual Environment
if [ ! -d ".venv" ]; then
echo "Setting up Python virtual environment..."
python3 -m venv .venv
else
echo "Virtual environment already exists."
fi
echo "Activating virtual environment..."
source .venv/bin/activate
# 6. Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip
# 7. Install Python Dependencies
echo "Installing Python dependencies..."
pip install -r requirements.txt
# 8. Install Watchdog (recommended by Streamlit)
echo "Installing Watchdog..."
pip install watchdog
echo "Setup completed successfully!"
echo "Please ensure you have granted Accessibility permissions to your terminal application and Python interpreter as per the README instructions."