-
Notifications
You must be signed in to change notification settings - Fork 11
/
bootstrap.sh
68 lines (53 loc) · 1.6 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
#!/usr/bin/zsh
print -P "%F{green}--- bootstrapping dotfiles ---%f\n"
OHMYZSH=$HOME/.oh-my-zsh
ZSHRC=$HOME/.zshrc
ALIASES=$HOME/.aliases
GITCONFIG=$HOME/.gitconfig
GITIGNORE=$HOME/.gitignore
# config files
# install oh-my-zsh
if [ ! -e "$OHMYZSH" ]; then
print -P "%F{green}installing oh-my-zsh ...%f\n"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
fi
echo $ZSHRC
if [ ! -e "$ZSHRC" ]; then
print -P "%f{green}linking .zhsrc ...%f\n"
ln .zshrc $ZSHRC
fi
if [ ! -e "$ALIASES" ]; then
print -P "%f{yellow}linking .aliases ...%f\n"
ln .aliases $ALIASES
fi
if [ ! -e "$GITCONFIG" ]; then
print -P "%f{yellow}linking .gitconfig ...%f\n"
ln .gitconfig $GITCONFIG
fi
if [ ! -e "$GITIGNORE" ]; then
print -P "%f{yellow}linking .gitignore ...%f\n"
ln .gitignore $GITIGNORE
fi
# python
brew install pyenv
pyenv update && pyenv install-latest
# nvm
print -P "%f{yellow}--- installing .nvm ---%f\n"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# node
if (( $+commands[node] )); then
print -P "%F{yellow}node is already installed %f\n"
else
print -P "%F{green}installing node%f\n"
. ~/.nvm/nvm.sh
nvm install node # "node" is an alias for the latest version
fi
# vim
print -P "%f{yellow}--- setting up .vimrc ---%f\n"
zsh ./vim/install.sh
# vscode
print -P "%f{yellow}--- installing VSCode plugins ---%f\n"
zsh ./vscode/install.sh
source $ZSHRC
print -P "%f{green}exit 0 %f\n"