Skip to content

Commit dfc971e

Browse files
authored
Update setup.sh
1 parent 0e57844 commit dfc971e

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

setup.sh

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
set -e
44

5-
echo "Checking for Homebrew..."
5+
# Check if brew is installed
66
if ! command -v brew >/dev/null 2>&1; then
7-
echo "Homebrew not found. Installing Homebrew..."
8-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
9-
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
10-
eval "$(/opt/homebrew/bin/brew shellenv)"
11-
else
12-
echo "Homebrew already installed."
7+
echo "Installing Homebrew for Linux..."
8+
9+
# Install build tools (required for Linuxbrew)
10+
sudo apt-get update
11+
sudo apt-get install -y build-essential procps curl file git
12+
13+
# Install Homebrew
14+
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
15+
16+
# Add Homebrew to PATH
17+
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
18+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
1319
fi
1420

1521
echo "Updating Homebrew..."
@@ -21,11 +27,13 @@ brew install php
2127
echo "Installing MySQL..."
2228
brew install mysql
2329

24-
echo "Starting MySQL service..."
25-
brew services start mysql
30+
echo "Starting MySQL..."
31+
mysql.server start || echo "MySQL start may not be persistent without a proper init system."
2632

27-
echo "Verifying installations..."
33+
echo "PHP version:"
2834
php -v
35+
36+
echo "MySQL version:"
2937
mysql --version
3038

31-
echo "Setup complete."
39+
echo "All done!"

0 commit comments

Comments
 (0)