-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·152 lines (126 loc) · 4.57 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/bash
source $(dirname ${BASH_SOURCE})/trace.sh || die "Failed to find trace.sh"
declare -x ALL="no"
declare -x GOVERSION="1.11.1"
declare -x JAVAVERSION="11.0.1"
declare -x CFamilySupport
declare -x CSharpSupport
declare -x GoSupport
declare -x JavaSupport
declare -x RustSupport
declare -x ZshInstalled="not"
declare -x ZshGoPlugin="${HOME}/.oh-my-zsh/custom/golang_plugin.zsh"
declare -x ZshJdkPlugin="${HOME}/.oh-my-zsh/custom/java_plugin.zsh"
function usage() {
echo "${0##*/} usage:"
echo " -h : Print help message"
echo " -a : Install everything by default"
}
if [[ $# > 1 ]] ; then
usage
exit 1
elif [[ $# == 1 && $1 == "-h" ]] ; then
usage
exit 0
elif [[ $# == 1 && $1 == "-a" ]] ; then
echo "=============================================================="
warn "Everything will be installed"
echo "=============================================================="
ALL="yes"
fi
"Loom is going to be installed..."
confirmCont "So far, Loom is only tested on Ubuntu 1604/1804, are your sure you want to continue?" YES no
if [ ${ALL} = "yes" ] || confirm "Vim and Git are needed" y n y ; then
sudo apt install -y vim git
else
die "Aborted installation, since Vim and Git is aboslutely necessary!"
fi
info "Installing Vundle..."
if [ -d "${HOME}/.vim/bundle/Vundle.vim" ] ; then
cd ~/.vim/bundle/Vundle.vim
info "Updating Vundle.vim..."
git pull
cd - >> /dev/null
else
info "Installing Vundle.vim..."
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
cp -v ./vimrc_ubuntu1804 ~/.vimrc
info "Installing all plugins..."
vim +PluginInstall +qall
info "Installing build-essential cmake python3-dev..."
sudo apt install -y build-essential cmake python3-dev ack
if [ ${ALL} == "yes" ] || confirm "Enable C famaily language support..." y n y; then
sudo apt install -y exuberant-ctags cscope gdb gdb-doc g++ make
CFamilySupport="--clang-completer"
fi
if [ ${ALL} == "yes" ] || confirm "Enable CSharp support..." y n y; then
info "Installing Mono..."
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" \
| sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install -y mono-complete
CSharpSupport="--cs-completer"
fi
if [ ${ALL} == "yes" ] || confirm "Enable JavaScript support" y n y; then
wget -qO- https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g typescript
fi
if [ ${ALL} == "yes" ] || confirm "Enable Rust support" y n y; then
curl https://sh.rustup.rs -sSf | sh
info "Installing cargo and some extra package..."
sudo apt install -y cargo cargo-doc rust-doc rust-src \
libhttp-parser2.7.1 libstd-rust-1.28 libstd-rust-dev \
rust-gdb rustc rust-gdb rustc
RustSupport="--rust-completer"
fi
if [ ${ALL} == "yes" ] || confirm "Enable Go support" y n y; then
if [ ${ZshInstalled} == "not" ] ; then
bash $(dirname ${BASH_SOURCE})/zsh_install.sh
ZshInstalled="yes"
fi
info "Installing Go..."
bash $(dirname ${BASH_SOURCE})/go_install.sh ${GOVERSION} ${ZshGoPlugin}
source ${ZshGoPlugin}
GoSupport="--go-completer"
fi
if [ ${ALL} == "yes" ] || confirm "Enable Java support" y n y ; then
if [ ${ZshInstalled} == "not" ] ; then
bash $(dirname ${BASH_SOURCE})/zsh_install.sh
ZshInstalled="yes"
fi
info "Installing JDK..."
bash $(dirname ${BASH_SOURCE})/jdk_install.sh ${JAVAVERSION} ${ZshJdkPlugin}
source ${ZshJdkPlugin}
JavaSupport="--java-completer"
fi
info "Set up tern_for_vim..."
cd ~/.vim/bundle/tern_for_vim
npm install
info "Set up fonts..."
cd ~/.vim/bundle/fonts
./install.sh
info "Installing cargo and some extra package..."
sudo apt install -y cargo cargo-doc gdb-doc rust-doc rust-src \
libhttp-parser2.7.1 libstd-rust-1.28 libstd-rust-dev \
rust-gdb rustc rust-gdb rustc ack
info "Compiling YouCompleteMe, it may take a while..."
cd ~/.vim/bundle/YouCompleteMe
if [ ! -z "${CSharpSupport}" ] && [ ! -z "${CFamilySupport}" ] \
&& [ ! -z "${GoSupport}" ] && [ ! -z "${JavaSupport}" ] ; then
note "All languages are need to be supported"
fi
if [ ${ALL} == yes ] ; then
debug_run python3 install.py --all
else
debug_run python3 install.py ${CSharpSupport} \
${CFamilySupport} \
${GoSupport} \
${RustSupport} \
${JavaSupport}
fi
info "Return to your home directory..."
cd ~