-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.sh
executable file
·54 lines (44 loc) · 1.01 KB
/
provision.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
#!/bin/bash
# Provisions .vimrc, .tmux.conf and scripts (if any) to home dir
set -e
BLUE="\e[36m"
GREEN="\e[32m"
BOLD="\e[1m"
RESET="\e[0m"
user="FakeEmperor"
utilsRepo="https://github.com/${user}/re.utils"
path="$HOME/${user}_utils"
installPlugins=1
echoSkipped() {
echo -e "${BLUE}${BOLD}Skipped!${RESET}"
}
echoDone() {
echo -e "${GREEN}${BOLD}Done!${RESET}"
}
echo -en "${GREEN}[+] Cloning repo... ${RESET}"
set +e
git clone "$utilsRepo" "$path"
if [[ "$?" -eq 128 ]]; then
echoSkipped
elif [[ "$?" -ne 0 ]]; then
exit "$?"
else
echoDone
fi
set -e
cd "$path"
echo -en "${GREEN}[+] Copying configs... ${RESET}"
cp .vimrc ~/ || true
cp .bashrc ~/ || true
cp .tmux*.conf ~/ || true
echoDone
echo -en "${GREEN}[+] Installing VIM plugins... ${RESET}"
# install vim plugins
if [[ installPlugins -eq 1 ]]; then
echo -en "${GREEN}[+] Installing Vundle... ${RESET}"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall
echoDone
else
echoSkipped
fi