-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-brew.sh
executable file
·49 lines (35 loc) · 1.32 KB
/
install-brew.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# This is part of a larger script for setting a mac for python development.
set -e
# Shared functions
pretty_print() {
printf "\n%b\n" "$1"
}
#
pretty_print "Here we go..."
# So it begins
# Homebrew installation
if ! command -v brew &>/dev/null; then
pretty_print "Installing Homebrew, an OSX package manager, follow the instructions..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
if ! grep -qs "recommended by brew doctor" ~/.zshrc; then
pretty_print "Put Homebrew location earlier in PATH ..."
printf '\n# recommended by brew doctor\n' >> ~/.zshrc
printf 'export PATH="/usr/local/bin:$PATH"\n' >> ~/.zshrc
export PATH="/usr/local/bin:$PATH"
fi
else
pretty_print "You already have Homebrew installed...good job!"
fi
# Homebrew OSX libraries
pretty_print "Updating brew formulas"
brew update
pretty_print "Installing GNU core utilities..."
brew install coreutils
pretty_print "Installing GNU find, locate, updatedb and xargs..."
brew install findutils
# pretty_print "Installing the most recent verions of some OSX tools"
# brew tap homebrew/dupes
# brew install homebrew/dupes/grep
printf 'export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"' >> ~/.zshrc
export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"