11#! /usr/bin/env bash
2+ set -e
3+ set -o pipefail
24
35function echoo {
46 echo -e " \n\033[32m $1 \033[0m"
@@ -9,39 +11,40 @@ function backup {
911
1012 now=` date +%Y%m%dT%H-%M-%S`
1113 for i in $HOME /.vim $HOME /.vimrc; do
12- echo $i ' -->' $i .$now
13- [ -e $i ] && sudo mv $i $i .$now ;
14+ echoo $i ' --> ' $i .$now
15+ [ -e $i ] && sudo mv $i $i .$now
1416 done
17+
18+ echoo " >>> backup finished"
1519}
1620
1721platform=" "
1822for i in " Centos" ," Centos" " Ubuntu" ," Ubuntu" " Darwin" ," MacOSX" ; do
19- key=${i% ,* } ; value=${i#* ,} ;
20- if [ ` python -mplatform | grep -ic $key ` == 1 ]; then
23+ key=${i% ,* } ; value=${i#* ,} ;
24+ if [ ` python -mplatform | grep -ic $key ` == 1 ]; then
2125 platform=$value
22- echoo " You os is $platform ."
26+ echoo " >>> You os is $platform ."
2327 fi
2428done
2529
2630
27- read -p " Rebulid the vim and all plugins, Are you sure(Y/N)? " -n 1 -r
28- echo
29- if [[ $REPLY =~ ^[Yy]$ ]]; then
30- backup
31- case $platform in
32- Centos)
33- sudo bash scripts/init-vim-centos.sh
34- ;;
35- Ubuntu)
36- sudo bash scripts/init-vim-ubuntu.sh
37- ;;
38- MacOSX)
39- bash scripts/init-vim-osx.sh
40- echoo " >>> Install fonts for powerline ..."
41- bash fonts/install-fonts.sh
42- esac
43- sudo bash install-plugins.sh init
44- echoo " Install finished. If you need orther language support, please run: ./install-plugins.sh --help"
45- else
46- echoo " User cancels the operation."
47- fi
31+ backup
32+
33+ case $platform in
34+ Centos)
35+ sudo bash scripts/init-vim-centos.sh
36+ ;;
37+ Ubuntu)
38+ sudo bash scripts/init-vim-ubuntu.sh
39+ ;;
40+ MacOSX)
41+ echoo " >>> Install dependencies ..."
42+ bash scripts/init-vim-osx.sh
43+ echoo " >>> Install fonts for powerline ..."
44+ bash fonts/install-fonts.sh
45+ ;;
46+ esac
47+
48+ sudo bash install-plugins.sh init
49+
50+ echoo " Install finished. If you need orther language support, please run: ./install-plugins.sh --help"
0 commit comments