forked from simonsdave/ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfg4dev
48 lines (39 loc) · 1.15 KB
/
cfg4dev
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
configure_dev_env()
{
if [ ! -f "$PWD/requirements.txt" ]; then
echo "Must source this script from project's root directory"
return 1
fi
if [ -d "$PWD/env" ]; then
source "$PWD/env/bin/activate"
else
virtualenv env
if [ $? != 0 ]; then
echo "error creating virtualenv"
return 1
fi
source "$PWD/env/bin/activate"
pip install pip==1.5.6
pip install --process-dependency-links --requirement "$PWD/requirements.txt"
OSNAME=$(uname -s)
case "$OSNAME" in
Linux)
JQ_URL="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64"
;;
Darwin)
JQ_URL="https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64"
;;
*)
echo "Unsupported operating system '$OSNAME'" >&2
return 1
;;
esac
curl -s -L --output jq "$JQ_URL"
chmod u+x jq
mv jq "$PWD/env/bin/."
fi
export PATH=$PATH:"$PWD/bin"
export PYTHONPATH="$PWD"
return 0
}
configure_dev_env