-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_requirements.sh
77 lines (62 loc) · 1.5 KB
/
install_requirements.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
#!/bin/sh
# Check the OS we are running on
UNAME="$(uname -s)"
case "${UNAME}" in
Linux*) OS=Linux;;
Darwin*) OS=Mac;;
CYGWIN*) OS=Cygwin;;
MINGW*) OS=MinGw;;
*) OS="UNKOWN"
esac
echo 'Working on' ${OS}
# Exit if we can't figure the OS
if [ "${OS}" = "UKNOWN" ]; then
echo 'Uknown type of OS:'
uname -s
exit 1
fi
if [ "${OS}" = "Linux" ] || [ "${OS}" = "Mac" ]; then
VIMFOLDER="${HOME}/.vim"
else
VIMFOLDER="~\vimfiles"
fi
# Check Linux release
if [ "${OS}" = "Linux" ]; then
release="$(cat /etc/*release | grep PRETTY_NAME=)"
case "${release}" in
*CentOS*) DISTRO=CentOS;;
*Ubuntu*) DISTRO=Ubuntu;;
*Debian*) DISTRO=Debian;;
*) DISTRO="Other";
esac
fi
echo 'Linux distribution is' ${release}
# Get needed dependencies
if [ "${OS}" = "Linux" ]; then
if [ "${DISTRO}" = "Ubuntu" ] || [ "${DISTRO}" = "Debian" ]; then
if [[ $EUID -eq 0 ]]
then
apt-get update && \
apt-get install -y python3 \
curl \
vim \
fontconfig \
xfonts-utils \
libncurses5-dev \
libncursesw5-dev
else
sudo apt-get update && sudo apt-get install -y python3 \
curl \
vim \
fontconfig \
xfonts-utils \
libncurses5-dev \
libncursesw5-dev
fi
fi
if [ "${DISTRO}" = "CentOS" ]; then
sudo dnf install -y python3 curl vim
fi
fi
VIMVERSION="$(vim --version | head -1 | cut -d ' ' -f 5)"
echo 'Current VIM version installed is' ${VIMVERSION}