-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall-packages.sh
More file actions
49 lines (39 loc) · 886 Bytes
/
install-packages.sh
File metadata and controls
49 lines (39 loc) · 886 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
function printi {echo "[INFO] $*"}
function printe {echo "[ERROR] $*"}
function setup_arch {
# Package manager
PAC=pacman -S
VIRTUALENV=virtualenv2
# Packages
PYTHON_PAC=python2
PIP_PAC=python2-pip
VIRTUALENV_PAC=python2-virtualenv
}
function setup_ubuntu {
# Package manager
PAC=apt-get install
# Packages
PYTHON_PAC=python
}
function install_pac {
while $#; do
case $1; in
"python")
[ command -v $PYTHON_PAC ] || $PAC $PYTHON_PAC $PIP_PAC $VIRTUALENV_PAC
$VIRTUALENV --no-site-packages $HOME/bin/py/
# Local copy of virtualenv
pip install virtualenv
esac
done
}
if command -v pacman; then
printi "You are running arch"
setup_arch
elif command -v apt-get; then
printi "You are running ubuntu"
setup_ubuntu
else
printe "Cannot determine you distribution, sorry."
exit 1
fi