Laptop

Laptop is a script to set up an OS X laptop for web development. It's based on what thoughtbot did here.

It can be run multiple times on the same machine safely. It installs, upgrades, or skips packages based on what is already installed on the machine.

Requirements

I've tested this on:

  • macOS Sierra (10.12)

Older versions may work but aren't regularly tested.

Install

Download the script:

curl --remote-name https://raw.githubusercontent.com/thoughtbot/laptop/master/mac

Review the script (avoid running scripts you haven't read!):

less mac

Execute the downloaded script:

sh mac 2>&1 | tee ~/laptop.log

Optionally, review the log:

less ~/laptop.log

Debugging

Your last Laptop run will be saved to ~/laptop.log. Read through it to see if you can debug the issue yourself. If not, let me know; I might be able to help.

What it sets up

macOS tools:

  • Homebrew for managing operating system libraries
  • Homebrew Cask for managing Mac applications distributed as binaries from the CLI

Unix tools:

Heroku tools:

Programming languages, package managers, and configuration:

  • LibYAML is a YAML 1.1 parser and emitter needed by Ruby
  • Yarn is a package manager
  • NVM for running apps and installing JavaScript packages
  • Java 8 for running big ol' Java apps
  • Maven for build automation
  • Ant to help build Java applications
  • Bundler for managing Ruby libraries
  • Ruby stable for writing general-purpose code
  • RVM for managing Ruby environments
  • Saas for writing useful CSS

Servers:

  • Tomcat 8 is a "pure Java" HTTP web server environment in which Java code can run.

Databases:

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

Customize in ~/.laptop.local

Your ~/.laptop.local is run at the end of the Laptop script. Put your customizations there.

For example:

#!/bin/sh

brew bundle --file=- <<EOF
cask "sublime-text"
cask "spectacle"
cask "slack"
cask "sourcetree"
cask "skitch"
cask "sketch"
cask "cyberduck"
cask "balsamiq-mockups"
cask "spotify"
cask "android-file-transfer"
cask "onedrive"
EOF

Write your customizations such that they can be run safely more than once. See the mac script for examples.

Laptop functions such as fancy_echo and gem_install_or_update can be used in your ~/.laptop.local.