-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhomebrew.sh
30 lines (22 loc) · 882 Bytes
/
homebrew.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# WARNING: This file is not meant to be run directly.
####################
# Homebrew #
####################
# Homebrew is a wonderful package manager and the first thing I would install
# on any machine.
install_homebrew() {
if exec_exists brew; then
echo "-- Homebrew is already installed"
return
fi
echo "-- Installing Homebrew..."
HOMEBREW_INSTALL_URL="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL ${HOMEBREW_INSTALL_URL})"
# Add Homebrew to path
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
echo "-- Homebrew has been installed"
}
install_homebrew
add_to_bash_profile "# Add homebrew to environment" "eval \$($(brew --prefix)/bin/brew shellenv)"