File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33set -e
44
5- echo " Checking for Homebrew... "
5+ # Check if brew is installed
66if ! 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) "
1319fi
1420
1521echo " Updating Homebrew..."
@@ -21,11 +27,13 @@ brew install php
2127echo " Installing MySQL..."
2228brew 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: "
2834php -v
35+
36+ echo " MySQL version:"
2937mysql --version
3038
31- echo " Setup complete. "
39+ echo " All done! "
You can’t perform that action at this time.
0 commit comments