brew 설치
This commit is contained in:
1 parent
fc8faeafa5
commit
83e4be78ac
3 files changed
+72
-18
No files matched your search
+23
-6
@@ -43,6 +43,26 @@ Darwin | Linux) ;;
|
||||
;;
|
||||
esac
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Ensure Homebrew is available on macOS
|
||||
# ────────────────────────────────────────────
|
||||
ensure_brew() {
|
||||
if command -v brew &>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
info "Homebrew is not installed. Installing Homebrew..."
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
# Add brew to PATH for Apple Silicon
|
||||
if [ -d /opt/homebrew/bin ]; then
|
||||
export PATH="/opt/homebrew/bin:$PATH"
|
||||
fi
|
||||
if [ -d /usr/local/bin ]; then
|
||||
export PATH="/usr/local/bin:$PATH"
|
||||
fi
|
||||
command -v brew &>/dev/null || error "Homebrew installation failed. Install it manually: https://brew.sh/"
|
||||
success "Homebrew installed"
|
||||
}
|
||||
|
||||
info "Platform: $OS ($ARCH)"
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
@@ -56,12 +76,9 @@ if command -v tmux &>/dev/null; then
|
||||
else
|
||||
case "$OS" in
|
||||
Darwin)
|
||||
if command -v brew &>/dev/null; then
|
||||
brew install -y tmux
|
||||
success "tmux installed via Homebrew"
|
||||
else
|
||||
error "Homebrew (brew) is required on macOS. Install it from https://brew.sh/"
|
||||
fi
|
||||
ensure_brew
|
||||
brew install tmux
|
||||
success "tmux installed via Homebrew"
|
||||
;;
|
||||
Linux)
|
||||
if command -v apt-get &>/dev/null; then
|
||||
|
||||
Reference in new issue
Block a user