-
Notifications
You must be signed in to change notification settings - Fork 13
/
dotfiles
63 lines (48 loc) · 1.35 KB
/
dotfiles
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
set -o errexit
REPO_URL=https://github.com/protiumx/.dotfiles.git
REPO_PATH="$HOME/.dotfiles"
reset_color=$(tput sgr 0)
info() {
printf "%s[*] %s%s\n" "$(tput setaf 4)" "$1" "$reset_color"
}
success() {
printf "%s[*] %s%s\n" "$(tput setaf 2)" "$1" "$reset_color"
}
err() {
printf "%s[*] %s%s\n" "$(tput setaf 1)" "$1" "$reset_color"
}
warn() {
printf "%s[*] %s%s\n" "$(tput setaf 3)" "$1" "$reset_color"
}
install_xcode() {
if xcode-select -p >/dev/null; then
warn "xCode Command Line Tools already installed"
else
info "Installing xCode Command Line Tools..."
xcode-select --install
sudo xcodebuild -license accept
fi
}
install_homebrew() {
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
if hash brew &>/dev/null; then
warn "Homebrew already installed"
else
info "Installing homebrew..."
sudo --validate # reset `sudo` timeout to use Homebrew install in noninteractive mode
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
}
info "####### dotfiles #######"
read -p "Press enter to start:"
info "Bootstraping..."
install_xcode
install_homebrew
info "Installing Git"
brew install git
info "Cloning .dotfiles repo from $REPO_URL into $REPO_PATH"
git clone "$REPO_URL" "$REPO_PATH"
info "Change path to $REPO_PATH"
cd "$REPO_PATH" >/dev/null
./install.sh