forked from JDevlieghere/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·92 lines (79 loc) · 2.03 KB
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·92 lines (79 loc) · 2.03 KB
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
#!/usr/bin/env bash
pushd `dirname $0` > /dev/null
DOTFILES=`pwd -P`
popd > /dev/null
info () {
printf "\033[00;34m$@\033[0m\n"
}
doUpdate() {
info "Updating"
git pull origin master;
}
doSync() {
info "Syncing"
rsync --exclude ".git/" \
--exclude "installers/" \
--exclude ".DS_Store" \
--exclude "bootstrap.sh" \
--exclude "README.md" \
--exclude ".gitignore" \
--filter=':- .gitignore' \
-avh --no-perms . ~;
}
doLink() {
if [ ! -e ~/.config/nvim ]; then
mkdir -p ~/.config
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
fi
}
doInstall() {
info "Installing Extras"
curl -sL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
if [ "$(uname)" == "Darwin" ]; then
source "$DOTFILES/installers/brew.sh"
fi
source "$DOTFILES/installers/python.sh"
}
doFonts() {
info "Installing Fonts"
if [ "$(uname)" == "Darwin" ]; then
fonts=~/Library/Fonts
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
fonts=~/.fonts
mkdir -p "$fonts"
fi
find "$DOTFILES/fonts/" -name "*.[o,t]tf" -type f | while read file; do cp -v "$file" "$fonts"; done
}
doConfig() {
info "Configuring"
if [ "$(uname)" == "Darwin" ]; then
echo "Configuring OSX"
source "$DOTFILES/.macos"
fi
echo "Configuring global gitignore"
git config --global core.excludesfile ~/.gitignore_global
echo "Reloading ZSH"
exec /bin/zsh -l
}
doAll() {
doUpdate
doSync
doLink
doInstall
doFonts
doConfig
}
if [ "$1" == "--sync" ]; then
doSync
doLink
elif [ "$1" == "--install" ]; then
doInstall
elif [ "$1" == "--fonts" ]; then
doFonts
else
doAll
fi