Navigation Menu

Skip to content

Commit

Permalink
[thoughtbot#32] Run each command "successfully"
Browse files Browse the repository at this point in the history
* Halt execution of the script at the point that something fails.
* Update total expected time now that `brew install qt` is faster.
* Combine scripts into one file so we don't have to duplicate or
  source the `successfully` function.
  • Loading branch information
Dan Croak authored and Dan Croak committed Oct 2, 2012
1 parent 50a1a1e commit eb6a701
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 42 deletions.
15 changes: 9 additions & 6 deletions README.md
Expand Up @@ -8,7 +8,11 @@ Requirements

* Install a C compiler, such as GCC, LLVM, or Clang.

Download a compiler from the [OS X GCC Installer](https://github.com/kennethreitz/osx-gcc-installer/) if you're on Snow Leopard (OS X 10.6) or use the [Command Line Tools for XCode](https://developer.apple.com/downloads/index.action) for Lion (OS X 10.7) or Mountain Lion (OS X 10.8).
Use [OS X GCC Installer](https://github.com/kennethreitz/osx-gcc-installer/) for
Snow Leopard (OS X 10.6).

Use [Command Line Tools for XCode](https://developer.apple.com/downloads/index.action)
for Lion (OS X 10.7) or Mountain Lion (OS X 10.8).

* Set zsh as your login shell.

Expand Down Expand Up @@ -42,21 +46,20 @@ What it sets up
* SSH public key for authenticating with Github and Heroku
* Tmux for saving project state and switching between projects

It should take less than 30 minutes to install (depends on your machine).
It should take less than 15 minutes to install (depends on your machine).

Credits
-------

![thoughtbot](http://thoughtbot.com/images/tm/logo.png)

Laptop is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community).

Thank you to all [the contributors](https://github.com/thoughtbot/laptop/contributors)!

The names and logos for thoughtbot are trademarks of thoughtbot, inc.

Thank you, [contributors](/thoughtbot/laptop/graphs/contributors)!

License
-------

Laptop is Copyright © 2011-2012 thoughtbot, inc. It is free software, and may be
Laptop is © 2011-2012 thoughtbot, inc. It is free software, and may be
redistributed under the terms specified in the LICENSE file.
4 changes: 0 additions & 4 deletions heroku

This file was deleted.

54 changes: 38 additions & 16 deletions mac 100644 → 100755
@@ -1,47 +1,69 @@
#!/usr/bin/env zsh

successfully() {
$* || (echo "failed" 1>&2 && exit 1)
}

echo "Checking for SSH key, generating one if it doesn't exist ..."
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa

echo "Copying public key to clipboard. Paste it into your Github account ..."
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | pbcopy
open https://github.com/account/ssh
successfully open https://github.com/account/ssh

echo "Installing RVM (Ruby Version Manager) ..."
curl -L https://get.rvm.io | bash -s stable --ruby
echo "
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'" >> ~/.zshrc
source ~/.zshrc
successfully source ~/.zshrc

echo "Installing Ruby 1.9.3 stable and making it the default Ruby ..."
successfully rvm install 1.9.3 --with-gcc=clang
successfully rvm use 1.9.3 --default

echo "Installing Bundler to build gem dependencies ..."
successfully gem install bundler -v '~> 1.2.0.rc.2' --no-rdoc --no-ri

echo "Installing Rails to write and run web applications ..."
successfully gem install rails --no-rdoc --no-ri

echo "Installing the Heroku gem to interact with the http://heroku.com API ..."
successfully gem install heroku --no-rdoc --no-ri

echo "Installing the pg gem to talk to Postgres databases ..."
successfully gem install pg --no-rdoc --no-ri

zsh < <(curl -s https://raw.github.com/thoughtbot/laptop/master/ruby)
echo "Installing the foreman gem for serving your Rails apps in development mode ..."
successfully gem install foreman --no-rdoc --no-ri

echo "Installing Homebrew, a good OS X package manager ..."
ruby <(curl -fsS https://raw.github.com/mxcl/homebrew/go)
brew update
successfully ruby <(curl -fsS https://raw.github.com/mxcl/homebrew/go)
successfully brew update

echo "Put Homebrew location earlier in PATH ..."
echo "
successfully echo "
# recommended by brew doctor
export PATH='/usr/local/bin:$PATH'" >> ~/.zshrc
source ~/.zshrc
successfully source ~/.zshrc

echo "Installing Postgres, a good open source relational database ..."
brew install postgres --no-python
successfully brew install postgres --no-python

echo "Installing ack, a good way to search through files ..."
brew install ack
successfully brew install ack

echo "Installing tmux, a good way to save project state and switch between projects ..."
brew install tmux
successfully brew install tmux

echo "Installing reattach-to-user-namespace, for copy-paste and RubyMotion compatibility with tmux ..."
brew install reattach-to-user-namespace
successfully brew install reattach-to-user-namespace

echo "Installing ImageMagick, good for cropping and re-sizing images ..."
brew install imagemagick
successfully brew install imagemagick

echo "Installing QT, used by Capybara Webkit for headless Javascript integration testing ..."
brew install qt
successfully brew install qt

zsh < <(curl -s https://raw.github.com/thoughtbot/laptop/master/heroku)
echo "Installing the heroku-config plugin for pulling config variables locally to be used as ENV variables ..."
successfully heroku plugins:install git://github.com/ddollar/heroku-config.git
16 changes: 0 additions & 16 deletions ruby

This file was deleted.

0 comments on commit eb6a701

Please sign in to comment.