forked from thoughtbot/laptop
/
mac
executable file
·86 lines (63 loc) · 2.45 KB
/
mac
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env zsh
# Welcome to Matt's laptop script! Forked from thoughbot.
# Be prepared to turn your laptop (or desktop, no haters here)
# into an awesome development machine.
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
fancy_echo() {
printf "\n%b\n" "$1"
}
if [ ! -d "$HOME/.bin/" ]; then
fancy_echo "Creating home .bin folder ..."
mkdir "$HOME/.bin"
fi
if [ ! -d "$HOME/Sites/" ]; then
fancy_echo "Creating Sites folder ..."
mkdir "$HOME/Sites"
fi
if [[ -f /etc/zshenv ]]; then
fancy_echo "Fixing OSX zsh environment bug ..."
sudo mv /etc/{zshenv,zshrc}
fi
echo "Checking for SSH key, generating one if it doesn't exist ..."
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
fancy_echo "Installing Homebrew, a good OS X package manager ..."
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew update
fancy_echo "Tap Homebrew dependencies ..."
brew tap homebrew/dupes
fancy_echo "Cloning and installing dotfiles, running setup scripts ..."
git clone https://github.com/mattbanks/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
script/bootstrap
fonts/copy
iterm2/setup
sublime3/setup
xcode/setup
fancy_echo "Setting up hosts file ..."
cat /etc/hosts | grep sites.whatup || sudo printf "\n##\n# Matt's hosts\n##\n192.168.56.101 sites.whatup\n" | sudo tee -a /etc/hosts
fancy_echo "Cloning Vagrant dev box ..."
git clone https://github.com/mattbanks/vagrant-dev-box.git ~/vmdevbox
fancy_echo "Installing git, Node.js, Z Script ..."
brew install git node z
fancy_echo "Installing rbenv, to change Ruby versions ..."
brew install rbenv
fancy_echo "Installing rbenv-gem-rehash so the shell automatically picks up binaries after installing gems with binaries..."
brew install rbenv-gem-rehash
fancy_echo "Installing ruby-build, to install Rubies ..."
brew install ruby-build
fancy_echo "Installing Ruby 2.0.0-p247 ..."
rbenv install 2.0.0-p247
fancy_echo "Setting Ruby 2.0.0-p247 as global default Ruby ..."
rbenv global 2.0.0-p247
rbenv rehash
source ~/.zshrc
fancy_echo "Updating to latest Rubygems version ..."
gem update --system
fancy_echo "Installing critical Ruby gems for Rails development ..."
gem install bundler rails compass --no-document
fancy_echo "Installing Essential NPM Packages - Grunt, Yeoman and Bower, because you need them ..."
npm install -g yo grunt-cli bower npm-check-updates
fancy_echo "Setting up OSX defaults ..."
cd ~/.dotfiles
osx/set-defaults.sh