-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbootstrap.sh
executable file
·135 lines (102 loc) · 3.18 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/bin/env bash
step_count=0
highlight=$(tput setaf 4)
text=$(tput sgr0)
log () {
printf "[$2] ${highlight}$1 ${text}\n"
}
# ---
log "Bootstrapping" "!"
# ---
step_count=$[$step_count+1]
log "Updating Homebrew..." $step_count
if test ! $(which brew); then
echo Installing homebrew...
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/dane/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
brew update --quiet
brew upgrade --quiet
# ---
step_count=$[$step_count+1]
log "Installing Packages..." $step_count
PACKAGES=(
awscli
git
gnupg
gnupg2
jq
neovim
nvm
python
starship
tmux
)
for item in "${PACKAGES[@]}"; do
brew info "${item}" | grep --quiet 'Not installed' && brew install "${item}"
done
# ---
step_count=$[$step_count+1]
log "Installing Fonts..." $step_count
FONTS=(
font-hack-nerd-font
)
brew tap homebrew/cask-fonts
for item in "${FONTS[@]}"; do
brew info "${item}" | grep --quiet 'Not installed' && brew install --cask "${item}"
done
# ---
step_count=$[$step_count+1]
log "Verifying Homebrew..." $step_count
brew cleanup --quiet
brew missing --quiet
# ---
step_count=$[$step_count+1]
log "Configuring Git..." $step_count
git config --global include.path "~/.dotfiles/.gitconfig"
git config --global user.name "Dane Thurber"
git config --global user.email "[email protected]"
# ---
step_count=$[$step_count+1]
log "Creating User Folders/Files..." $step_count
[[ ! -d ~/Notes ]] && mkdir ~/Notes
[[ ! -d ~/Playground ]] && mkdir ~/Playground
[[ ! -d ~/Projects ]] && mkdir ~/Projects
[[ ! -d ~/.config ]] && mkdir ~/.config
[[ ! -d ~/.nvm ]] && mkdir ~/.nvm
[[ ! -d ~/.secrets ]] && mkdir ~/.secrets
# ---
step_count=$[$step_count+1]
log "Installing ohmyzsh" $step_count
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# ---
step_count=$[$step_count+1]
log "Symlinking Config Files..." $step_count
[[ ! -d ~/.config/lvim/config.lua ]] && ln -nfs ~/.dotfiles/lvim/config.lua ~/.config/lvim/config.lua
[[ ! -d ~/.config/starship.toml ]] && ln -nfs ~/.dotfiles/starship.tom ~/.config/starship.toml
[[ ! -d ~/.psqlrc ]] && ln -nfs ~/.dotfiles/.psqlrc ~/.psqlrc
[[ ! -d ~/.editorconfig ]] && ln -nfs ~/.dotfiles/.editorconfig ~/.editorconfig
[[ ! -d ~/.tmux.conf ]] && ln -nfs ~/.dotfiles/tmux/.tmux.conf ~/.tmux.conf
[[ ! -d ~/.zshrc ]] && ln -nfs ~/.dotfiles/zsh/.zshrc ~/.zshrc
# [[ ! -d ~/.vimrc ]] && ln -nfs ~/.dotfiles/vim/.vimrc ~/.vimrc
# [[ ! -d ~/.config/nvim/init.lua ]] && ln -nfs ~/.dotfiles/neovim/init.lua ~/.config/nvim/init.lua
# [[ ! -d ~/coc-settings.json ]] && ln -nfs ~/.dotfiles/coc-settings.json ~/coc-settings.json
# ---
step_count=$[$step_count+1]
log "Installing Node" $step_count
nvm install node
# ---
if test ! $(which cargo); then
step_count=$[$step_count+1]
log "Installing Rust" $step_count
curl https://sh.rustup.rs -sSf | sh
fi
# ---
if test ! $(which lvim); then
step_count=$[$step_count+1]
log "Installing LunarVim" $step_count
bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh)
fi
# ---
log "Bootstrapping Completed! \n" "!"