Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 170 lines (148 sloc) 4.8 KB
#!/usr/bin/env zsh
#
# Let's get this computer up-and-running!
#
# We're going to need this function later...
successfully() {
$* || (echo "failed" 1>&2 && exit 1)
}
#
# Intro, of course
#
echo " "
echo " A house-elf is a magical creature which is devoted and loyal to "
echo " the one designated as their master."
echo " They serve wizards and witches and must do everything their masters
command unless they are freed."
echo " A house-elf can only be freed when their master presents them with clothes."
echo " "
echo " "
echo " Fight! Fight for my master, the defender of the house-elves!"
echo " Fight the Dark Lord, in the name of brave Regulus!"
echo " Fight!"
echo " —Kreacher leading the house-elves during the Battle of Hogwarts."
echo " "
echo " "
#
# Homebrew
#
echo "`whoami`: Kreacher! Get me Homebrew, the best package installer for Mac OS X"
successfully ruby <(curl -fsS https://raw.github.com/mxcl/homebrew/go)
successfully brew update
successfully echo "# recommended by brew doctor export PATH='/usr/local/bin:$PATH'" >> ~/.zshenv
successfully source ~/.zshenv
#
# Alfred & Macvim
#
echo " "
if test -d /Applications/Alfred.app -o -d ~/Applications/Alfred.app
then
echo " Kreacher applauds Master `whoami`'s taste"
else
echo " Kreacher has gone away and found Alfred for Master"
curl http://cachefly.alfredapp.com/alfred_1.3.1_261.dmg -o "alfred_1.3.1_261.dmg"
successfully hdiutil attach alfred_1.3.1_261.dmg
fi
echo " "
echo " "
if test -d /Applications/MacVim.app -o -d ~/Applications/MacVim.app
then
echo " Kreacher has found MacVim...good...very good!"
else
echo " Kreacher: Begin installing MacVim now!!!!"
brew install macvim
fi
echo " "
#
# GCC Issues Fixes
#
echo " Installing GNU Compiler Collection and dependencies ..."
successfully brew tap homebrew/dupes
successfully brew install autoconf automake apple-gcc42
#
# Git
#
echo " Even cantankerous house-elves like Kreacher recognize the importance of version control."
echo " "
successfully brew install git
#
# Git Setup
#
echo " "
echo " Kreacher: Master `whoami`, do you already have Git credentials set up? (y or n) > \c"
read git_setup_already
if [ "$git_setup_already" == "n" ]
then
echo "Enter Your Full Name for Git > \c"
read $git_name
git config --global user.name $git_name
echo "Enter Your Email Address for Git > \c"
read $git_email
git config --global user.email $git_email
else
echo " "
echo " Oh, look who is fancy now!?"
echo " "
fi
#
# Zsh
#
echo " Kreacher has brought you Oh-My-Zsh!"
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
echo " Time to enter SSH key into Github, if this is not done yet. Will open your Github account."
if [ -e ~/.ssh/id_rsa.pub ]
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | pbcopy
open https://github.com/account/ssh
else
ssh-keygen -t rsa -C $git_email
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | pbcopy
open https://github.com/account/ssh
fi
echo " Installing MySql"
successfully brew install mysql
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
echo " Installing Postgres, a good open source relational database ..."
successfully brew link ossp-uuid
successfully brew install postgres --no-python
echo " Installing ack, a good way to search through files ..."
successfully brew install ack
#
# RVM
#
echo " Installing RVM (Ruby Version Manager) and Ruby 1.9.3, which becomes the default ..."
successfully curl -L https://get.rvm.io | bash -s stable --ruby
successfully echo "
# RVM
[[ -s '/Users/`whoami`/.rvm/scripts/rvm' ]] && source '/Users/`whoami`/.rvm/scripts/rvm'" >> ~/.zshenv
source ~/.zshenv
#
# Rubygems Update
#
echo " Updating Rubygems"
successfully gem update
echo " Installing critical Ruby gems for Rails development ..."
successfully gem install bundler rails heroku pg foreman thin --no-rdoc --no-ri --quiet
echo " Installing Redis, a fast, in-memory object store"
successfully brew install redis
echo " Installing Whim, Wistia Vim Plugins"
mv ~/.vimrc ~/.vimrc.backup && mv ~/.gvimrc ~/.gvimrc.backup
mkdir -p ~/.vim/autoload ~/.vim/bundle
successfully curl https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim \
> ~/.vim/autoload/pathogen.vim
successfully git clone git://github.com/wistia/whim.git ~/.whim
cd ~/.whim
git submodule update --init
ln -s ~/.whim/local/default.vimrc ~/.vimrc
ln -s ~/.whim/local/default.gvimrc ~/.gvimrc
cd ~/.whim/bundle/command-t/ruby/command-t
rvm use system
ruby extconf.rb
make
rvm use default
#
# Permissions Fix
#
successfully sudo chown -R `whoami` /usr/local