forked from manojlds/xconf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.env
36 lines (34 loc) · 908 Bytes
/
.env
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
use_python() {
typeset penv
penv="$1"
if pythonbrew list | grep -q $penv; then
pythonbrew use $penv
else
echo -n "Install python-$penv? (y/n) "
read answer
if [[ "$answer" == "y" ]]; then
pythonbrew install $penv
pythonbrew use $penv
fi
fi
}
use_env() {
typeset venv
venv="$1"
if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then
if pythonbrew venv list | grep -q "$venv"; then
pythonbrew venv use $venv
else
echo -n "Create virtualenv $venv now? (y/n) "
read answer
if [[ "$answer" == "y" ]]; then
pythonbrew venv create "$venv"
pythonbrew venv use $venv
pip install -r requirements/dev.txt
fi
fi
fi
}
use_python 2.7.3
use_env xconf
export DJANGO_SETTINGS_MODULE=xconf.settings.dev