Skip to content

Commit e65a4e1

Browse files
author
Aaron O'Mullan
committed
Add python virtualenv support in init.sh
1 parent 83db4cb commit e65a4e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

init.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
WORKSPACE="${HOME}/workspace/"
55
SSH_DIR="${HOME}/.ssh/"
66
SERVER_SCRIPT="/opt/codebox/bin/codebox.js"
7+
PYTHON_ACTIVATE="/opt/virtualenv/bin/activate"
78

89
## Variables provided by environment
910
# RSA_PRIVATE, RSA_PUBLIC
@@ -111,6 +112,12 @@ function setup_env () {
111112
unset GIT_PASSWD
112113
}
113114

115+
function setup_python () {
116+
if [ -e "${PYTHON_ACTIVATE}" ]; then
117+
source "${PYTHON_ACTIVATE}"
118+
fi;
119+
}
120+
114121
function start_server () {
115122
echo "Calling start_server ..."
116123

@@ -125,4 +132,5 @@ setup_netrc
125132
setup_git
126133
setup_perm
127134
setup_env
135+
setup_python
128136
start_server

0 commit comments

Comments
 (0)