Skip to content

Instantly share code, notes, and snippets.

@k3n
Last active June 20, 2019 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k3n/d0616ef46a9a3213d8bed3a88ec5146e to your computer and use it in GitHub Desktop.
Save k3n/d0616ef46a9a3213d8bed3a88ec5146e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
cd ~
# Install command line tools
xcode-select -r
xcode-select -p
if [[ $? -ne 0 ]]; then
xcode-select --install
fi
# A full installation of Xcode.app is required to compile macvim.
# Installing just the Command Line Tools is not sufficient.
xcodebuild -version
if [[ $? -ne 0 ]]; then
# TODO: find a way to install Xcode.app automatticaly
# See: http://stackoverflow.com/a/18244349
# Accept Xcode license
sudo xcodebuild -license
fi
# Install Homebrew if not found
brew --version
if [[ $? -ne 0 ]]; then
# Clean-up failed Homebrew install
rm -rf "/usr/local/Cellar" "/usr/local/.git"
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew update
brew install git
git clone https://github.com/k3n/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
script/bootstrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment