-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·54 lines (41 loc) · 1.06 KB
/
setup.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
#!/bin/bash
#
# Script to setup a virtual environment with pip for Django and associated plugins
function abspath {
if [[ -d "$1" ]]
then
pushd "$1" >/dev/null
pwd
popd >/dev/null
elif [[ -e $1 ]]
then
pushd $(dirname $1) >/dev/null
echo $(pwd)/$(basename $1)
popd >/dev/null
else
echo $1 does not exist! >&2
return 127
fi
}
# Remove old compiled files
find . -name '*.pyc' | xargs -I{} rm -rf {}
ARGS=$@
APPS_DIR='apps'
CURR_REL_DIR=$(dirname $0)
CURR_DIR=$(abspath "${CURR_REL_DIR}")
virtualenv --no-site-packages $CURR_DIR
SRC_DIR="${CURR_DIR}/src"
if [ ! -d "${SRC_DIR}" ]; then
mkdir "${SRC_DIR}"
fi
"$CURR_DIR/bin/easy_install" "setuptools==15.2"
"$CURR_DIR/bin/easy_install" "pip==6.1.1"
"$CURR_DIR/bin/pip" install -r "$CURR_DIR/requirements.txt" $ARGS
if [ ! -d "${CURR_DIR}/assets" ]; then
mkdir "$CURR_DIR/assets"
mkdir "$CURR_DIR/assets/media"
mkdir "$CURR_DIR/assets/media/files"
mkdir "$CURR_DIR/assets/media/img"
mkdir "$CURR_DIR/assets/static"
fi
echo "from .base import *" > $CURR_DIR/apps/wysiwyg_admin/settings/local.py