#!/bin/sh set -e BOLD="\033[1m" GREEN="\033[32m" YELLOW="\033[33m" RED="\033[31m" RESET="\033[0m" info() { printf "${BOLD}${GREEN}==>${RESET} ${BOLD}%s${RESET}\n" "$1"; } warn() { printf "${BOLD}${YELLOW}warning:${RESET} %s\n" "$1"; } error() { printf "${BOLD}${RED}error:${RESET} %s\n" "$1"; exit 1; } info "Installing baid..." # Try Homebrew first (macOS / Linux with brew) if command -v brew >/dev/null 2>&1; then info "Homebrew detected — installing via brew" brew install baid-dev/tap/baid info "baid installed successfully!" baid version exit 0 fi # Try gem if command -v gem >/dev/null 2>&1; then info "Ruby detected — installing via gem" gem install baid info "baid installed successfully!" baid version exit 0 fi # No brew or gem — guide the user echo "" warn "Neither Homebrew nor Ruby/gem found on your system." echo "" echo "Install baid using one of these methods:" echo "" echo " ${BOLD}macOS/Linux (recommended):${RESET}" echo " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"" echo " brew install baid-dev/tap/baid" echo "" echo " ${BOLD}Any system with Ruby:${RESET}" echo " gem install baid" echo "" error "Could not auto-install baid. Please install Homebrew or Ruby first."