From eb6a701471e722eccb9e925326b9354cdcdb6819 Mon Sep 17 00:00:00 2001 From: Dan Croak Date: Fri, 3 Aug 2012 16:51:41 -0400 Subject: [PATCH] [#32] Run each command "successfully" * 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. --- README.md | 15 +++++++++------ heroku | 4 ---- mac | 54 ++++++++++++++++++++++++++++++++++++++---------------- ruby | 16 ---------------- 4 files changed, 47 insertions(+), 42 deletions(-) delete mode 100644 heroku mode change 100644 => 100755 mac delete mode 100644 ruby diff --git a/README.md b/README.md index dcde5738d..ea44f8b44 100644 --- a/README.md +++ b/README.md @@ -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. @@ -42,7 +46,7 @@ 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 ------- @@ -50,13 +54,12 @@ 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. diff --git a/heroku b/heroku deleted file mode 100644 index c302a97cf..000000000 --- a/heroku +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo "Installing the heroku-config plugin for pulling config variables locally to be used as ENV variables ..." - heroku plugins:install git://github.com/ddollar/heroku-config.git diff --git a/mac b/mac old mode 100644 new mode 100755 index 0ec4f1b67..7cb5d4577 --- a/mac +++ b/mac @@ -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 diff --git a/ruby b/ruby deleted file mode 100644 index 07dc537ab..000000000 --- a/ruby +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -echo "Installing Bundler to build gem dependencies ..." - gem install bundler -v '~> 1.2.0.rc.2' --no-rdoc --no-ri - -echo "Installing Rails to write and run web applications ..." - gem install rails --no-rdoc --no-ri - -echo "Installing the Heroku gem to interact with the http://heroku.com API ..." - gem install heroku --no-rdoc --no-ri - -echo "Installing the pg gem to talk to Postgres databases ..." - gem install pg --no-rdoc --no-ri - -echo "Installing the foreman gem for serving your Rails apps in development mode ..." - gem install foreman --no-rdoc --no-ri