-
Notifications
You must be signed in to change notification settings - Fork 494
/
10_osx.sh
34 lines (28 loc) · 1.08 KB
/
10_osx.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
# OSX-only stuff. Abort if not OSX.
[[ "$OSTYPE" =~ ^darwin ]] || return 1
# Some tools look for XCode, even though they don't need it.
# https://github.com/joyent/node/issues/3681
# https://github.com/mxcl/homebrew/issues/10245
if [[ ! -d "$('xcode-select' -print-path 2>/dev/null)" ]]; then
sudo xcode-select -switch /usr/bin
fi
# Install Homebrew.
if [[ ! "$(type -P brew)" ]]; then
e_header "Installing Homebrew"
true | /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
fi
if [[ "$(type -P brew)" ]]; then
e_header "Updating Homebrew"
brew update
# Install Homebrew recipes.
recipes=(git tree sl lesspipe id3tool nmap git-extras htop-osx man2html)
list="$(to_install "${recipes[*]}" "$(brew list)")"
if [[ "$list" ]]; then
e_header "Installing Homebrew recipes: $list"
brew install $list
fi
if [[ ! "$(type -P gcc-4.2)" ]]; then
e_header "Installing Homebrew dupe recipe: apple-gcc42"
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
fi
fi