forked from rkalis/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·45 lines (36 loc) · 1.28 KB
/
bootstrap.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env sh
DIR=$(dirname "$0")
cd "$DIR"
. scripts/functions.sh
info "Installing XCode command line tools..."
if xcode-select --print-path &>/dev/null; then
success "XCode command line tools already installed."
elif xcode-select --install &>/dev/null; then
success "Finished installing XCode command line tools."
else
error "Failed to install XCode command line tools."
fi
info "Installing homebrew …"
if brew -v foo >/dev/null 2>&1; then
success "Homebrew already installed."
elif /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; then
success "Installed Homebrew"
else
error "Failed to install Homebrew"
fi
# Setup ZSH ever earlier, so the brew command can be found?
./zsh/setup.sh
# Package control must be executed first in order for the rest to work
./packages/setup.sh
info "Prompting for sudo password..."
if sudo -v; then
# Keep-alive: update existing `sudo` time stamp until `setup.sh` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
success "Sudo credentials updated."
else
error "Failed to obtain sudo credentials."
fi
find * -name "setup.sh" -not -wholename "packages*" | while read setup; do
./$setup
done
success "Finished installing Dotfiles"