Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 102 lines (75 sloc) 2.695 kB
#!/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
# Create ~/.bin if it doesn't exist
if [[ ! -d "$HOME/.bin/" ]]; then
mkdir "$HOME/.bin"
fi
# Create ~/.zshrc if it doesn't exist
if [ ! -f "$HOME/.zshrc" ]; then
touch $HOME/.zshrc
fi
# Create ~/Sites if it doesn't exist
if [ ! -d "$HOME/Sites/" ]; then
mkdir "$HOME/Sites"
fi
# Create ~/Code if it doesn't exist
if [ ! -d "$HOME/Code/" ]; then
mkdir "$HOME/Code"
fi
fancy_echo() {
printf "\n%b\n" "$1"
}
# Create shell to zsh
fancy_echo "Changing your shell to zsh ..."
chsh -s $(which zsh)
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
if ! command -v brew &>/dev/null; then
fancy_echo "Installing Homebrew, a good OS X package manager ..."
ruby <(curl -fsS https://raw.githubusercontent.com/Homebrew/homebrew/go/install)
else
fancy_echo "Homebrew already installed. Skipping ..."
fi
fancy_echo "Updating Homebrew formulas ..."
brew update
fancy_echo "Installing git, Node.js, Z Script, VVV Site Setup ..."
brew install git node z vv
fancy_echo "Installing rbenv, to change Ruby versions ..."
brew install rbenv
eval "$(rbenv init -)"
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.2.2 ..."
rbenv install 2.22.2
fancy_echo "Setting Ruby 2.2.2 as global default Ruby ..."
rbenv global 2.22.2
rbenv rehash
fancy_echo "Updating to latest Rubygems version ..."
gem update --system
fancy_echo "Installing critical Ruby gems for development ..."
gem install bundler sass
fancy_echo "Installing Essential NPM Packages ..."
npm install -g yo grunt-cli bower gulp jshint npm-check-updates
fancy_echo "Cloning Vagrant dev box ..."
git clone git@github.com:Varying-Vagrant-Vagrants/VVV.git ~/vvv
fancy_echo "Installing WP-CLI"
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
# Get rid of zshrc and move on to the dotfiles
rm ~/.zshrc
fancy_echo "Cloning and installing dotfiles ..."
hub clone dotfiles ~/.dotfiles
cd ~/.dotfiles
fonts/copy
script/bootstrap
Jump to Line
Something went wrong with that request. Please try again.