-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·99 lines (87 loc) · 2.16 KB
/
bootstrap
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
#!/usr/bin/env bash
#
# bootstrap installs things.
DOTFILES=$HOME/.dotfiles # export? "`pwd`"
set -e
info () {
printf " [ \033[00;34m..\033[0m ] $1\n"
}
user () {
printf "\r [ \033[0;33m?\033[0m ] $1\n"
}
success () {
printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n"
}
fail () {
printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n"
echo ''
exit
}
init () {
info "Initializing git submodules..."
git submodule init
git submodule update
}
backup () {
info "Backing up old configuration files..."
mv ~/.vimrc ~/.vimrc-bak
mv ~/.zshrc ~/.zshrc-bak
mv ~/.vim ~/.vim-bak
mv ~/.gitconfig ~/.gitconfig-bak
mv ~/.gitignore ~/.gitignore-bak
mv ~/.tmux.conf ~/.tmux.conf-bak
}
# General
install-bin () {
info "Installing binary files..."
chmod u+x $DOTFILES/bin/*
ln -fs $DOTFILES/bin ~/.bin
}
install-shell () {
info "Installing shell configs..."
ln -fs $DOTFILES/shell/zshrc ~/.zshrc
ln -fs $DOTFILES/shell/tmux ~/.tmux.conf
ln -fs $DOTFILES/shell/tmuxinator ~/.tmuxinator
}
install-oh-my-zsh () {
info "Installing oh-my-zsh..."
ln -fs ../../cwoebker.zsh-theme $DOTFILES/shell/oh-my-zsh/themes/cwoebker.zsh-theme
#ln -fs $DOTFILES/shell/oh-my-zsh ~/.oh-my-zsh
}
install-vim () {
info "Linking vim setup..."
ln -fs $DOTFILES/vim ~/.vim
info "Updating vim plugins..."
info "-----------------------"
git submodule foreach git pull origin master --recurse-submodules
info "-----------------------"
}
install-atom () {
info "Linkiung atom setup..."
ln -fs $DOTFILES/atom ~/.atom
}
install-git () {
info "Installing git configs..."
ln -fs $DOTFILES/git/gitconfig ~/.gitconfig
ln -fs $DOTFILES/git/gitignore ~/.gitignore
}
install-virtualenvwrapper () {
info "Installing virtualenvwrapper custom hooks..."
mkdir -p ~/.virtualenvs/
ln -fs $DOTFILES/virtualenvwrapper/* ~/.virtualenvs/
}
install () {
info "Installing cwoebker's dotfiles..."
info "---------------------------------"
info " "
install-bin
install-shell
install-oh-my-zsh
install-vim
install-atom
install-git
#install-virtualenvwrapper
info "--------------------------------------------"
success "Installtion of cwoebker's dotfiles complete!"
}
install