forked from douban/code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_code.sh
More file actions
executable file
·27 lines (23 loc) · 735 Bytes
/
install_code.sh
File metadata and controls
executable file
·27 lines (23 loc) · 735 Bytes
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
#!/usr/bin/env bash
# Check Python version > 2.7
test `python -c 'import sys; print sys.version_info < (2, 7)'` = "True" && echo 'CODE requires Python 2.7.'; exit 1
url='https://raw.github.com/douban/code/master/scripts'
if [ -f /etc/fedora-release ] ; then
file="$url/fedora.sh"
elif [ -f /etc/redhat-release ] ; then
file="$url/centos.sh"
elif [ -f /etc/SuSE-release ] ; then
file="$url/opensuse.sh"
elif [ -f /etc/debian_version ] ; then
file="$url/ubuntu.sh"
elif [ -f /etc/gentoo-release ] ; then
file="$url/gentoo.sh"
elif [ -f /etc/arch-release ] ; then
file="$url/archlinux.sh"
else
echo "Not yet support the system!"
exit 1
fi
curl -O "$url/common.sh"
bash <(curl -s $file)
rm common.sh -f