-
Notifications
You must be signed in to change notification settings - Fork 1
/
mk-venv.sh
executable file
·40 lines (34 loc) · 1.05 KB
/
mk-venv.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
#!/bin/sh
# Create a virtualenv in /ramdisk
#
# This is how Zygmunt Krynicki works, feel free to use or adjust to your needs
VENV_PATH=${1:-/ramdisk/venv}
if [ -z "$(which virtualenv)" ]; then
echo "You need to install virtualenv to continue"
echo "On Ubuntu:"
echo " sudo apt-get install python-virtualenv"
exit 1
fi
if [ -z "$(which python3)" ]; then
echo "You need to install python3 to continue"
echo "On Ubuntu:"
echo " sudo apt-get install python3"
exit 1
fi
if [ ! -d $(dirname $VENV_PATH) ]; then
echo "This script requires $(dirname $VENV_PATH) directory to exist"
echo "You can use different directory by passing it as argument"
echo "For a quick temporary location just pass /tmp/venv"
exit 1
fi
if [ ! -d $VENV_PATH ]; then
virtualenv -p python3 $VENV_PATH
. $VENV_PATH/bin/activate
easy_install -U distribute
easy_install -U coverage
python3 setup.py develop
else
echo "$VENV_PATH seems to exist already"
fi
echo "To activate your virtualenv run:"
echo " $ . $VENV_PATH/bin/activate"