-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·44 lines (39 loc) · 1.03 KB
/
run.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
#!/bin/bash
contains()
# echo contains check $1 in $2
case "$1" in
(*"$2"*) true;;
(*) false;;
esac
debug() {
echo "$1"
}
debug "\nAPI Logic Project Runner 1.0 Here ($# arg(s): $1)"
if [ $# -eq 1 ]
then
if contains "help" $1; then
echo "\nRuns API Logic Project"
echo " sh run.sh [ calling | $ | help ]"
echo " no args - use project venv"
echo " calling - use venv from calling script (for internal tests)"
echo " $ - use the current venv\n"
exit 0
elif [ "$1" == "$" ]; then
debug ".. Using existing venv -- $VIRTUAL_ENV"
else
debug ".. Calling directory - venv from $PWD"
cd $PWD
. venv/bin/activate
fi
else
debug " "
if [ "${APILOGICSERVER_RUNNING}" = "DOCKER" ]; then
debug ".. Docker - no venv required"
else
debug ".. APILOGICSERVER_RUNNING=${APILOGICSERVER_RUNNING} - not Docker/Codespaces - activate venv"
. venv/bin/activate
fi
fi
cd "$(dirname "$0")"
PYTHONHASHSEED=0
python3 api_logic_server_run.py