-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmacos-setup
More file actions
executable file
·33 lines (25 loc) · 1.16 KB
/
Copy pathmacos-setup
File metadata and controls
executable file
·33 lines (25 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
# Inspired by https://mths.be/macos and https://github.com/kentcdodds/dotfiles/blob/master/.macos
# Run without downloading:
# curl https://raw.githubusercontent.com/sfroehler/dotfiles/master/macos-setup | bash
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
if [[ ! -d "${HOME}/.dotfiles" ]]; then
echo "Cloning dotfiles ..."
git clone git@github.com:sfroehler/dotfiles.git ~/.dotfiles
ln -sf ~/.dotfiles/laptop.local ~/.laptop.local
ln -sf ~/.dotfiles/rcrc ~/.rcrc
fi
# Install oh-my-zsh
if [[ ! -d "${HOME}/.oh-my-zsh/" ]]; then
echo "Installing oh-my-zsh ..."
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
echo "Executing thoughtbot laptop script"
curl --remote-name https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
sh mac 2>&1 | tee ~/laptop.log