Skip to content

A shell script which turns your OS X laptop into an awesome web development machine.

License

Notifications You must be signed in to change notification settings

jtschulz/laptop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laptop

Laptop is a script to set up an OS X laptop for web development.

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.

It is based on thoughtbot/laptop.

Requirements

We support:

Older versions may work but aren't regularly tested. Bug reports for older versions are welcome.

Base Install

Download, review, then execute the script:

curl --remote-name https://raw.githubusercontent.com/PepperTeasdale/laptop/master/mac.sh
less mac.sh
sh mac.sh 2>&1 | tee ~/laptop.log

In order to ensure consistent Docker environment, it should be downloaded manually from the Docker website.

Mac Download Windows Download

For OS X Sierra + (10.12+) and XCode 8:

With Xcode 8.0, when trying to compile the gem you may get the error Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild. — even after confirming the license agreement. This is an upstream Qt bug that can be worked around by following these instructions:

  1. Find the Qt install folder

  2. Open [Qt_install_folder]/[Qt_version](/clang_64 || )/mkspecs/features/mac/default_pre.prf in a text editor

    If you can't find the file, look for it by searching all files for the following line by running grep -rn /usr/bin/xcrun . in the [Qt_install_folder] or [Qt_version] director

    For this laptop script and Qt 5.5.1, you edit the file directly in VIM via the command line:

    vim /usr/local/Cellar/[email protected]/5.5.1/mkspecs/features/mac/default_pre.prf

  3. Find the line with this text (for me it was line 15):

    isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \

  4. Replace line with:

    isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \

  5. Save & re-install the gem

For further reading: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#macos-sierra-1012

kutil Install

pushd /usr/local/bin
curl --remote-name https://raw.githubusercontent.com/policygenius/laptop/master/kutil.rb
mv kutil{.rb,}
chmod +x kutil
popd

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, copy the lines where the script failed into a new GitHub Issue for us. Or, attach the whole log file as an attachment.

Google Cloud Platform setup

  • Log into GCP with the gcloud command
    • gcloud auth login
  • Configure gcloud to use the sandbox project
    • gcloud config set project pg-sandbox-165613
  • Configure kubectl to use the sandbox Kubernetes cluster
    • gcloud container clusters get-credentials sandbox-v3 --zone us-central1-f --project pg-sandbox-165613

What it sets up

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_tap 'caskroom/cask'
brew_install_or_upgrade 'brew-cask'

brew cask install dropbox
brew cask install google-chrome
brew cask install rdio

gem_install_or_update 'parity'

brew_install_or_upgrade 'tree'
brew_install_or_upgrade 'watch'

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

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

About

A shell script which turns your OS X laptop into an awesome web development machine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 78.1%
  • Ruby 21.9%