forked from luan/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·86 lines (71 loc) · 1.98 KB
/
install
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
#!/usr/bin/env bash
FILES_TO_LINK="vimrc gvimrc"
LOCALS=".vimrc.local.before .vimrc.local .vimrc.local.plugins"
DIR=$(cd $(dirname $0) && pwd)
if [ "$DIR" != "$HOME/.vim" ]; then
dot_file=$HOME/.vim
if [ ! -e $dot_file ]; then
echo "Detected clone outside of ~/.vim, symlinking"
ln -s $DIR $dot_file
fi
fi
pushd $DIR
if [ -e $DIR/bundle ]; then
rm -rf $DIR/bundle
fi
git submodule update --init --recursive
for file in $LOCALS; do
dot_file=$HOME/$file
touch $dot_file
done
for file in $FILES_TO_LINK; do
dot_file=$HOME/.$file
if [ ! -e $dot_file ]; then
ln -s $DIR/$file $dot_file
fi
done
if [ "$(uname)" == "Darwin" ]; then
VIM_UPDATE_PATH=/usr/local/bin/vim-update
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
VIM_UPDATE_PATH=$HOME/bin/vim-update
fi
if [ ! -e $VIM_UPDATE_PATH ]; then
ln -s $DIR/update $VIM_UPDATE_PATH
fi
green='\033[0;32m'
yellow='\033[0;33m'
bold=`tput bold`
normal=`tput sgr0`
end_color='\033[0;m'
if which go > /dev/null; then
echo -e "${yellow}INSTALL${end_color} ${bold}golang${normal} dependencies..."
gopackages="\
github.com/golang/lint/golint \
github.com/jstemmer/gotags \
github.com/kisielk/errcheck \
github.com/nsf/gocode \
golang.org/x/tools/cmd/godoc \
golang.org/x/tools/cmd/goimports \
golang.org/x/tools/cmd/gorename \
golang.org/x/tools/cmd/oracle \
golang.org/x/tools/cmd/vet \
"
for p in $gopackages; do
(
echo -e "\t${yellow}INSTALL${end_color} ${bold}${p}${normal}..."
go get -f -u $p
echo -e "\t${green}DONE${end_color} ${bold}${p}${normal}"
)
done
echo -e "${green}DONE${end_color} ${bold}golang${normal} dependencies"
fi
if [ "$1" == "--non-interactive" ]; then
vim +'silent! PlugClean!' +qall > /dev/null
vim +'silent! PlugUpdate' +qall > /dev/null
vim +'silent! GoInstallBinaries' +qall > /dev/null
else
vim +'silent! PlugClean!' +qall
vim +'silent! PlugUpdate' +qall
vim +'silent! GoInstallBinaries' +qall
fi
popd