-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdevelop-linux
More file actions
executable file
·54 lines (40 loc) · 960 Bytes
/
Copy pathdevelop-linux
File metadata and controls
executable file
·54 lines (40 loc) · 960 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
50
51
52
#!/bin/bash
VIRTUAL_ENV_PATH="../cohpy.org-venv"
create_virtual_environment() {
echo "* Creating virtual environment $VIRTUAL_ENV_PATH"
if ! python3 -m venv $VIRTUAL_ENV_PATH; then
echo "Unable to create virtual environment"
exit 2
fi
}
activate_virtual_environment() {
echo "* Activating virtual environment"
source "$VIRTUAL_ENV_PATH/bin/activate"
}
install_requirements(){
echo "* Installing requirements"
pip install -r requirements.txt
}
if [[ "$PWD" != */cohpy.org ]]; then
echo "You need to be in the cohpy.org directory to run this script" >&2
exit 1
fi
if [[ "$1" == "setup" ]]; then
echo "setup"
if [[ ! -d $VIRTUAL_ENV_PATH ]]; then
create_virtual_environment
fi
activate_virtual_environment
install_requirements
exit 0
fi
if [ "$1" == "develop" ]; then
echo "develop"
activate_virtual_environment
fi
if [ "$1" == "run" ]; then
echo "run"
fi
if [ "$1" == "test" ]; then
echo "test"
fi