-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
executable file
·108 lines (100 loc) · 2.71 KB
/
install.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
#!/bin/bash
# https://github.com/taeguk/vim-taeguk
echo -e "\n ********** vim-taeguk ********** \n"
git_fail() {
echo "
[!] git is not installed in system!
[!] git must be required to vim-taeguk!
[!] please install git before installing vim-taeguk
"
}
echo "[*] checking if git is installed..."
hash git 1>&2 2>/dev/null || (git_fail ; exit 1) || exit 1
echo -e "\n[*] checking if ~/.vim exists..."
if [ -e ~/.vim ]
then
echo "[!] existing ~/.vim founded!!"
echo -n "Do you delete original .vim ?? (Y/N/B/U) >> "
read sel
if [ $sel = "Y" ] || [ $sel = "y" ]
then
echo "[*] rm -rf ~/.vim"
rm -rf ~/.vim
echo "[*] cp -rf .vim ~/"
cp -rf .vim ~/
elif [ \( $sel = "B" -o $sel = "b" \) ]
then
if [ -e ~/.vim_bckp ]; then
echo "[!] ~/.vim_bckp exists!!"
echo "[*] task calcelled!"
exit 1
fi
echo "[*] mv ~/.vim ~/.vim_bckp"
mv ~/.vim ~/.vim_bckp
echo "[*] cp -rf .vim ~/"
cp -rf .vim ~/
elif [[ $sel = "U" || $sel = "u" ]]
then
hash rsync 1>&2 2>/dev/null
if [ $? -ne 0 ]
then
echo "[!] Cannot run in Update mode!"
echo "[*] task calcelled!"
exit 1
fi
echo "[*] rsync -a .vim/ ~/.vim/"
rsync -a .vim/ ~/.vim/
else
echo "[*] task calcelled!"
exit 1
fi
else
echo "[*] cp -rf .vim ~/"
cp -rf .vim ~/
fi
echo -e "\n[*] checking if ~/.vimrc exists..."
if [ -e ~/.vimrc ]
then
echo "[!] existing ~/.vimrc founded!!"
echo -n "Do you delete original .vimrc ?? (Y/N/B) >> "
read sel
if [ $sel = "Y" ] || [ $sel = "y" ]
then
echo "[*] rm -rf ~/.vimrc"
rm -rf ~/.vimrc
echo "[*] cp -rf .vimrc ~/"
cp -rf .vimrc ~/
elif [ \( $sel = "B" -o $sel = "b" \) ]
then
if [ -e ~/.vimrc_bckp ]; then
echo "[!] ~/.vimrc_bckp exists!!"
echo "[*] task calcelled!"
exit 1
fi
echo "[*] mv ~/.vimrc ~/.vimrc_bckp"
mv ~/.vimrc ~/.vimrc_bckp
echo "[*] cp -rf .vimrc ~/"
cp -rf .vimrc ~/
else
echo "[*] task calcelled!"
exit 1
fi
else
echo "[*] cp -rf .vimrc ~/"
cp -rf .vimrc ~/
fi
echo -e "\n[*] Plugin managing start!"
if [ ! -d ~/.vim/bundle/Vundle.vim ]
then
echo "[*] Vundle.vim install...!"
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
echo "[*] Plugin clean start!"
vim +PluginClean! +qall
echo "[*] Plugin clean finish!"
echo "[*] Plugin install start!"
vim +PluginInstall +qall
echo "[*] Plugin install finish!"
echo "[*] Plugin managing finish!"
echo -e "\n[*] All progress was done!\n"
exit 0