From d8fca44222dac63b2033f66dfb255f87b6020c32 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Oct 2025 14:28:46 +0000 Subject: [PATCH 1/5] Initial plan From 5d13ca93410f8045515a9e2b702edc892f4d0c58 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Oct 2025 14:33:35 +0000 Subject: [PATCH 2/5] Fix sudo execution and add Xcode Command Line Tools check Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com> --- install.sh | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 26ceb5d..cf79d07 100755 --- a/install.sh +++ b/install.sh @@ -17,6 +17,14 @@ if [[ "$OSTYPE" != "darwin"* ]]; then exit 1 fi +# Check if running as root/sudo +if [ "$EUID" -eq 0 ]; then + echo "❌ This script should NOT be run with sudo or as root" + echo " Homebrew installation requires a regular user account" + echo " Please run without sudo: curl -fsSL https://raw.githubusercontent.com/munezaclovis/setup/refs/heads/main/install.sh | bash" + exit 1 +fi + # Function to check if command exists command_exists() { command -v "$1" >/dev/null 2>&1 @@ -33,19 +41,45 @@ cleanup() { # Set trap to cleanup on exit trap cleanup EXIT +# Function to check and install Xcode Command Line Tools +ensure_xcode_tools() { + # Check if Xcode Command Line Tools are installed + if ! xcode-select -p &>/dev/null; then + echo "📦 Xcode Command Line Tools are required but not installed" + echo " Installing Xcode Command Line Tools..." + echo " This is required for Homebrew and other development tools" + + # Trigger the installation + xcode-select --install 2>/dev/null || true + + echo "" + echo "⚠️ IMPORTANT: A dialog box has appeared to install Xcode Command Line Tools" + echo " Please click 'Install' and wait for the installation to complete" + echo " This may take several minutes depending on your internet connection" + echo "" + echo " After installation completes, please re-run this script:" + echo " curl -fsSL https://raw.githubusercontent.com/munezaclovis/setup/refs/heads/main/install.sh | bash" + echo "" + exit 1 + else + echo "✅ Xcode Command Line Tools already installed" + fi +} + # Function to clone setup repository clone_setup_repo() { echo "📥 Downloading setup files..." # Install git first if not present + # Git should be available with Xcode Command Line Tools, but check anyway if ! command_exists git; then echo "📦 Installing git..." if command_exists brew; then brew install git else - # If Homebrew not available yet, install via Xcode command line tools - xcode-select --install 2>/dev/null || true - echo "⚠️ Please install Xcode command line tools and re-run this script" + echo "❌ Git is not available and Homebrew is not installed yet" + echo " This shouldn't happen if Xcode Command Line Tools are installed" + echo " Please ensure Xcode Command Line Tools are properly installed" exit 1 fi fi @@ -183,6 +217,9 @@ ENV_EOF main() { echo "🔧 Installing development tools..." + # Check for Xcode Command Line Tools first + ensure_xcode_tools + # Clone the setup repository first clone_setup_repo From a2b680fb5f7fa541fc04cfd9318a07eda20f54d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Oct 2025 15:56:02 +0000 Subject: [PATCH 3/5] Clarify sudo requirements in error message and dnsmasq setup Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com> --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index cf79d07..7d33b5d 100755 --- a/install.sh +++ b/install.sh @@ -22,6 +22,9 @@ if [ "$EUID" -eq 0 ]; then echo "❌ This script should NOT be run with sudo or as root" echo " Homebrew installation requires a regular user account" echo " Please run without sudo: curl -fsSL https://raw.githubusercontent.com/munezaclovis/setup/refs/heads/main/install.sh | bash" + echo "" + echo " Note: The script will prompt for sudo password when needed for specific tasks" + echo " (e.g., dnsmasq setup), but the script itself should run as a regular user." exit 1 fi @@ -118,6 +121,7 @@ install_oh_my_zsh() { # Function to setup dnsmasq for .local domains setup_dnsmasq() { echo "🌐 Setting up dnsmasq for .local domain resolution..." + echo " Note: This step requires sudo access to modify system configuration" # Create config directory if it doesn't exist mkdir -p "$(brew --prefix)/etc/" From 7114af1b7ba5cbc50dd396263d90f851406c5d4c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Oct 2025 16:47:11 +0000 Subject: [PATCH 4/5] Add warning for non-interactive mode Homebrew installation Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com> --- install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/install.sh b/install.sh index 7d33b5d..7150549 100755 --- a/install.sh +++ b/install.sh @@ -96,6 +96,21 @@ clone_setup_repo() { install_homebrew() { if ! command_exists brew; then echo "📦 Installing Homebrew..." + + # Check if running in non-interactive mode + if [ ! -t 0 ]; then + echo "" + echo "⚠️ WARNING: Running in non-interactive mode (stdin is not a TTY)" + echo " Homebrew installation requires sudo access and needs to prompt for your password." + echo "" + echo " If the installation fails, please run this script interactively:" + echo " 1. Download: curl -fsSL https://raw.githubusercontent.com/munezaclovis/setup/refs/heads/main/install.sh -o setup.sh" + echo " 2. Run: bash setup.sh" + echo "" + echo " Attempting Homebrew installation anyway..." + sleep 2 + fi + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Add Homebrew to PATH for Apple Silicon Macs From 97a35d408cce75bfd8f455f75a671679336a346f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Oct 2025 23:25:39 +0000 Subject: [PATCH 5/5] Check for Docker from any installation source, not just Homebrew Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com> --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 7150549..39a6034 100755 --- a/install.sh +++ b/install.sh @@ -275,11 +275,14 @@ main() { ) # Install Docker Desktop (includes daemon, buildx, and more) - if ! brew list --cask docker &>/dev/null; then + # Check if Docker is already available (from any source) + if command_exists docker; then + echo "✅ Docker already installed" + elif ! brew list --cask docker &>/dev/null; then echo "📦 Installing Docker Desktop..." brew install --cask docker else - echo "✅ Docker Desktop already installed" + echo "✅ Docker Desktop already installed via Homebrew" fi for package in "${brew_packages[@]}"; do